Codex CLI Pro 20x runtime: durable host auth via #22 secret ingestion #26
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Floot on Tokyo should get a Codex CLI runtime billed to ChatGPT Pro (20x), cloned from
claude-cli. The login must go through the secret-ingestion path from #22 / #25 — not through a Floot transcript, and not through asecrets.envvalue that is re-applied on every daemon start.#22 (
requestSecret/writeSecret, PR 25, not yet deployed) is the right ingestion UI. It is the wrong lifetime for ChatGPT-managed Codex auth.Two different secrets
auth.jsoncodex-clisandbox on the boxCODEX_HOMEwriteSecrettoday only unwrapstokenorpasswordand writes that string. A Codex bundle is a file, and Codex must write it back. A bearer cap cannot do that.Claude already has the sidecar pattern:
setup-hostedcopiesENDO_CLAUDE_OAUTH_TOKENinto~/.endo-claude-credentials/*.keybecause in-memory git credentials do not survive restart. Codex needs the same idea, plus writeback. Official ChatGPT-managed auth is~/.codex/auth.jsonwithcli_auth_credentials_store = "file"; Codex refreshes that file in place. Do not call the OAuth token endpoint ourselves.How to wire them
Deploy #22 first. Codex CLI must speak the same MCP tools as Claude (
requestSecret,writeSecret). Otherwise a Codex session will ask the operator to paste into chat again — the #22 failure mode.Do not put
auth.jsoninsecrets.envas a reload-every-start value. That is how Claude's long-lived subscription token works. Doing it for Codex throws away refreshes. Durable path is/var/lib/endo/codex-home/auth.json(0600,endo:endo), seeded once.Add one credential kind #22 does not have:
codexAuth(or a genericfile). Mint it the same way as bearer:secret: true+asCredential+secretKind: 'codexAuth'provideCodexAuthCredential(name, { audience, json }){ petName, kind: 'codexAuth', audience, byteLength }— never the JSONThat reuses the #22 UI and the form-field opt-in. It does not reuse
provideBearerCredential.Give the provisioner the cap, not the session guest.
setup-hostedshould holdcodex-credsand hand eachcodex-client-<sessionId>a mount ofCODEX_HOME, not a copy of the bytes in tool args. Sessions share one Pro 20x login. A session that calledrequestSecretand stored the cap under its own petname would vanish with that session and could not refresh for the next one.Refresh writes back into the sidecar, not into a Floot cap. Bind
/var/lib/endo/codex-homeread-write into the container. Do not havewriteSecretoverwrite the host file from a stale cap after a session.Keep #22 for everything else the Codex agent needs. Platform API keys, git tokens, service-account JSON:
requestSecret→ cap →writeSecretonto the session workspace. Same prompts: never paste in chat, never put inexec.What not to do
auth.jsoninto a Codex turn and the agentwriteSecrets it into the workspace. That is a session-scoped copy; refresh is lost; the next session is blind.ENDO_CODEX_AUTH_JSONfromsecrets.envon everyendo-daemonstart. That resetslast_refresh.auth.jsonacross Tokyo and a laptop. Official rule is one file per machine; concurrent refresh steals the token.Work to do
Endo
@endo/codex-sandboxcloned from@endo/claude-sandbox(factory, 9P, per-session client, hosted provisioner).localhost/codex:latest).codex-clinext toclaude-cli. Leaveclaude-clias the default until Codex is proven.codexAuthcredential kind + durable sidecar +CODEX_HOMEbind.allowEnvPassshould keepCODEX_*the way it already keepsCLAUDE_*.Host (
floot/nixos-config)services.endo.codexSandbox.enable(Claude stays on; they coexist).endo-codex-image.service,/var/lib/endo/codex-home,/var/lib/endo/codex-mounts.ENDO_EXTRA: setup-host / setup-peer / setup-hosted for the new package.auth.jsonfromsecrets.envon daemon start.Operator (cannot be automated)
codex loginorcodex login --device-authon a trusted machine with the Pro account.auth_modeischatgptand a refresh token is present (metadata only; do not paste the file into chat, Forgejo, or the Nix store)./var/lib/endo/codex-home/auth.json, or complete device-auth asendoafter the image exists.Sequence
codexAuth+ sidecar +CODEX_HOMEbind + MCP secret tools.requestSecretto the factory / machine-admin, then persist and forget the paste.auth.jsononce; after that the file on disk is the source of truth.The subscription login is host infrastructure that happens to use #22's ingestion UI. Per-task secrets stay on the #22 path unchanged.
Related: #22, #25