Add Repo.credential_dir for shared codex ChatGPT Plus/Pro auth - #397
Merged
Conversation
tildesrc
commented
Aug 24, 2026
Comment on lines
+144
to
+145
| with a container-local regular file — documented in ADR 0012 as the failure mode that drove the | ||
| switch to the non-rotating `CLAUDE_CODE_OAUTH_TOKEN`. |
Contributor
Author
There was a problem hiding this comment.
Suggested change
| with a container-local regular file — documented in ADR 0012 as the failure mode that drove the | |
| switch to the non-rotating `CLAUDE_CODE_OAUTH_TOKEN`. | |
| with a container-local regular file. |
Introduces `Repo.credential_dir` — a name relative to the secrets dir that the runner mounts read-write into every container for that repo at `/panopticon/credentials`. The codex adapter symlinks `auth.json` from there into `$CODEX_HOME` on container start, keeping rotating ChatGPT Plus/Pro tokens in sync across concurrent tasks on the same host. - `core/models.py`: `Repo.credential_dir` field - `core/dirs.py`: `credential_dir_path()` + `relativize_credential_dir()` - `taskservice/store_sqlalchemy.py`: new `credential_dir` column - `taskservice/service.py`: `_validate_credential_dir()` in create/update - `sessionservice/local_runner.py`: mount `--volume …:/panopticon/credentials:rw` - `sessionservice/spawner.py`: pass `credential_dir` to runner - `container/cli/codex.py`: `wire_credentials()` (symlink / API-key JSON), `cli_auth_credentials_store = "file"` in config, updated `auth_missing_detail` - `client.py`, `terminal/dashboard.py`: plumb `credential_dir` through the API client and the repo form (CredentialDirField widget) - `migrations/`: Alembic migration adding nullable `credential_dir` column - `docs/auth.md`: full Codex auth section explaining all three tiers and why symlinks work for codex (in-place truncate-write) but not Claude (atomic rename — see ADR 0012) - New tests: service validation, runner volume mounting, wire_credentials (symlink, API-key JSON, dangling symlink guard, no-op), auth_missing_detail (credential-dir path), config.toml `cli_auth_credentials_store` Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
tildesrc
force-pushed
the
panopticon/codex-credential-dir
branch
from
August 24, 2026 16:52
a6612c6 to
e7bd29c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Repo.credential_dir— a name (relative to the secrets dir) pointing at a host directory the runner mounts read-write into every container at/panopticon/credentialscontainer/cli/codex.py) symlinksauth.jsonfrom the mounted dir into$CODEX_HOMEon start, keeping rotating ChatGPT Plus/Pro refresh tokens in sync across concurrent taskscli_auth_credentials_store = "file"inconfig.tomlso codex uses file-based storage instead of the OS keyring (which isn't present in containers)CredentialDirFieldwidget to the dashboard repo form, validation in the task service (_validate_credential_dir), and volume mount logic in the local runnercredential_dircolumn to therepotabledocs/auth.mdnow documents all three codex credential tiers (API key, access token, Plus/Pro subscription) and explains why symlinks work for codex (in-place truncate-write viaFileAuthStorage::save) but not Claude (atomic rename — ADR 0012)wire_credentials,auth_missing_detail(credential-dir path), configcli_auth_credentials_store🤖 Generated with Claude Code