abstract-gpt
Codex login and session management, usable as a CLI and as the optional /gpt/*
category in abstract_toolserver. Requires Python 3.11+, Linux (for HTTP login
locking), and an installed Codex CLI.
pip install -e /srv/pyit/dev/abstract_gpt
abstract-gpt oauth-status
abstract-gpt login # device URL + code; approve in your browser
abstract-gpt launch -- # new interactive conversation
abstract-gpt exec -- "Explain this repository" # ephemeral noninteractive session
login --browser uses normal browser login. login --with-api-key reads a key
from stdin via Codex itself. API key usage has separate API billing. No key is
required for the ChatGPT subscription login flow.
Toolserver
Install in the toolserver's Python environment, then add alongside its Claude merge:
_merge_optional_toolset("abstract_gpt.toolset:get_toolset")
Restart the service to register these routes. They use the toolserver's existing
authentication and execute as its OS user (vm_mgr on this host):
| Route | Purpose |
|---|---|
/gpt/state |
Wrapper configuration and local login status |
/gpt/oauth_status |
Local credential availability; not a live entitlement probe |
/gpt/oauth_solution |
Login instructions |
/gpt/login_start |
Start device login, or return an existing attempt |
/gpt/login_poll |
Poll state, verification URL and one-time code |
/gpt/save_template |
Save config.toml privately |
/gpt/restore |
Restore config only when missing |
/gpt/set_model |
Set default_model; null clears wrapper default |
Use POST for mutations. Device login runs in a detached subprocess with a
15-minute timeout; a file lock prevents duplicate flows across gunicorn workers.
Poll until authenticated, failed, expired, or interrupted. After service
restart, an interrupted attempt can be started again. Failed login output remains in the private AG_ROOT/login-output.txt for local
diagnostics, and is cleared at the next attempt. Raw login output and stored
credentials are never returned by the HTTP tools. The device code is sensitive:
use the existing authenticated toolserver connection.
Storage and sessions
CODEX_HOME: existing Codex home, default~/.codex. Login and launch use the same store so Codex manages token refresh. No credentials are copied between users.AG_ROOT: wrapper storage, default~/.local/share/abstract_gpt, private mode 0700.AG_CODEX_BIN: optional executable path. Otherwise~/.local/bin/codex, then PATH. The user-local binary takes priority to avoid selecting a Snap launcher inside a restricted systemd service.abstract-gpt init,state,save-template,restore,set-model MODEL,login-start,login-poll, andoauth-solutionmirror their actions.launchstarts a new conversation by default; explicit Codex resume flags still work.execadds--ephemeral. Neither deletes existing sessions or changes sandbox/approval settings. Explicit model flags override the wrapper default.- A config template can contain user-configured secrets; it stays private and is never returned through the API. It does not include auth.json or transcripts.
This package does not emulate Claude's durable token export, destructive reset, or automatic quota fallback. Codex owns its cached authentication and renewal. A service login applies to that service account; other OS users log in separately.
Toolserver tools inside Codex
Optional pip install 'abstract-gpt[mcp]' reuses the existing protocol-neutral
abstract_claude.mcp bridge:
codex mcp add toolserver -- abstract-gpt mcp
The bridge honors TOOLSERVER_URL and the existing Hugpy operator credentials.
Validation
PYTHONPATH=src python -m unittest discover -s tests -v
Tests use a fake Codex executable; they never consume model credits or change real credentials. Authentication behavior follows the official Codex documentation.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file abstract_gpt-0.1.0.tar.gz.
File metadata
- Download URL: abstract_gpt-0.1.0.tar.gz
- Upload date:
- Size: 9.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ce3ef1f3310e8809114a6813592e8ab56d2a75797480c19deeb19fe59299d07d
|
|
| MD5 |
4dd03b238c3b9cdf794118c314125bbb
|
|
| BLAKE2b-256 |
18a0881c60eb02c3578fc0ea8cb7abfaedfb2d900c495673133443f005957470
|
File details
Details for the file abstract_gpt-0.1.0-py3-none-any.whl.
File metadata
- Download URL: abstract_gpt-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e599922d2c0b7fd98c54e441a48bee23cb47659969ab4137c765828d884ab4ac
|
|
| MD5 |
d77c3932282c63ac58299fca3aca8afd
|
|
| BLAKE2b-256 |
62aeba1939a3de47c12297c86f5521302b97e89d091a4b34529590112f282f25
|