Repository navigation
feat(compose): persist the Codex (ChatGPT subscription) login across recreates - #155
Merged
Merged
Conversation
…recreates openclaw reads the OpenAI Codex OAuth credential from $CODEX_HOME/auth.json, defaulting to ~/.codex. Inside a gateway container that path is not a mount, so a login done via `openclaw models auth login` disappears on the next recreate or redeploy and the operator has to sign in again. Set CODEX_HOME to /home/node/.openclaw/.codex in both service blocks, inside the config-dir bind, so the login lives on the host with the rest of the agent state. Not a secret and identical for every agent, so it is hardcoded rather than routed through docker.env — which also keeps it out of the OB-22 docker.env-vs-container drift check. Found while moving projectmanager to openai-codex/*: no login was present, both gpt-5.1-codex-mini and gpt-5.3-codex were refused by OpenAI, and the Venice fallback did not engage because the refusal arrives as a normal reply body, not a failed request. Co-Authored-By: Claude Fable 5.1 <[email protected]>
Co-Authored-By: Claude Fable 5.1 <[email protected]>
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.
Why
openclaw reads the OpenAI Codex OAuth credential from
$CODEX_HOME/auth.json(default~/.codex, seesrc/agents/cli-credentials.tsresolveCodexHomePath). In a gateway container that path is not a mount — only/home/node/.openclawand itsworkspaceare bound — so a login done inside the container is gone on the next recreate or redeploy.Change
One env entry in both service blocks (same rule as every other allowlisted key):
Inside the config-dir bind, so the login persists on the host with the agent's other state. Hardcoded rather than
${CODEX_HOME:-}because it is not a secret and is the same for every agent — and because that keeps it out ofdocker.env, so the daily OB-22 drift check (docker.env key ⇄ container env) has nothing to compare.Verified
docker compose configrendersCODEX_HOMEin both services..codex/is created by the login itself, under uid 1000, which owns the config dir.Rollout
Owner merge →
git pull/opt/openclawon 2ndClaw →docker compose -p projectmanager --env-file … up -d --force-recreate openclaw-gateway(plainup -dis a no-op) → owner runs the login inside the container. Other agents pick it up at their next recreate; it is inert until someone logs in.Context
Found moving
projectmanagertoopenai-codex/*: no login present, bothgpt-5.1-codex-miniandgpt-5.3-codexrefused by OpenAI, and the Venice fallback did not engage — the refusal comes back as a 200-shaped reply body, which the failover path does not treat as a failure. That second point is a separate finding, not addressed here.🤖 Generated with Claude Code