Skip to content

fix(codex): guide recovery from unimported agent auth - #116807

Merged
fuller-stack-dev merged 13 commits into
openclaw:mainfrom
jacobtomlinson:fix/codex-auth-migration-116763
Aug 1, 2026
Merged

fuller-stack-dev merged 13 commits into
openclaw:mainfrom
jacobtomlinson:fix/codex-auth-migration-116763

Conversation

@jacobtomlinson

@jacobtomlinson jacobtomlinson commented Jul 31, 2026 •

Copy link
Copy Markdown
Contributor

Closes #116763

What Problem This Solves

Managed agent-scoped Codex runs now use OpenClaw's canonical SQLite auth store and launch Codex with an ephemeral credential store. An installation that still has only agents/<id>/agent/codex-home/auth.json therefore reaches a downstream authentication failure after upgrading.

This PR detects that exact upgrade state before a model request and gives an agent-scoped, auth-only recovery command.

Boundary

This change does not automatically import OAuth material and does not restore a runtime fallback to Codex's file store.

  • The diagnostic applies only to managed local stdio Codex startup when no canonical OpenClaw profile resolves.
  • Existing canonical auth, prepared auth, remote transports, user-home Codex, and supported CODEX_API_KEY / OPENAI_API_KEY fallback continue normally.
  • Recovery remains explicit: the operator must use --include-secrets and target both the validated agent (--agent <id>) and exact migration item (--item auth:openai).
  • Invalid or unknown agent IDs fail before a target auth store is opened.

The durable invariant is: legacy Codex credentials remain inert until explicit secret-import consent, while a selected Codex route with neither canonical auth nor a supported fallback fails before a model request with an exact command for the owning agent.

Evidence

  • Final diff: 18 files, +464/-38 against current main (17 auth/migration/docs files plus one TUI test-reporting line required by the current fork-PR CI path).
  • 226 focused auth/migration tests passed on cb767758240e8279b3e39c1339cbaf941994243a across CLI migration/context/item selection and Codex auth bridge/shared-client/startup behavior; the focused remote-WebSocket sibling passed 8/8 when rerun in isolation. Exact head 409d495bd5c90494bb867f2eb4f787f470eb3d16 also passed the progress-reporting PTY harness 49/49.
  • Migration CLI/context/item/provider tests passed, including proof that OAuth lands in research and not default agent main.
  • Both CODEX_API_KEY and OPENAI_API_KEY fallback regressions pass.
  • Fresh complete-branch diff autoreview at 409d495bd5c90494bb867f2eb4f787f470eb3d16: clean, 0.98 confidence, no actionable findings; TruffleHog clean. Final head a6228bc98bdddbb67aec832ff84d135da039a175 adds only upstream xAI lifecycle movement and leaves the reviewed 18-file diff unchanged.
  • pnpm build, the full repository check gate, focused formatting, and git diff --check passed. A local macOS full-suite attempt exercised the relevant Codex/OpenAI shards successfully; its remaining failures reproduced current-main/platform assumptions (for example /var vs /private/var, Bash 3, missing GNU timeout, host launchctl, and timing-sensitive QA shards), so Linux hosted CI remains the merge gate.

Landing-head diagnostic proof

The exact auth implementation head f2806c54a7a5c8d6da4fbb90b6315eeef79388ea was built on Blacksmith Testbox lease tbx_01kyyg4hca315k4q81vr7dk808 (run). The built checkout reported OpenClaw 2026.7.2 (f2806c5) and loaded the bundled Codex plugin. Final landing candidate a6228bc98bdddbb67aec832ff84d135da039a175 merges current upstream main through b830a658217a02154c66a713b6060010b3f3e069. The only intervening auth-adjacent change is doctor JSON-to-SQLite ownership refactor #117361; it does not touch the 17-file auth surface, Codex startup bridge, explicit migrate CLI, or their fixtures. Upstream #117331 moved the slow TUI PTY smoke into build-artifacts, but fork PRs use the low-core hosted path and its 120-second no-output watchdog killed the buffered reporter. An isolated exact-head diagnostic passed 16/16 in 325.5s with verbose progress, and the final one-line config repair passed its PTY harness 49/49. The auth diff and implementation remain byte-for-byte unchanged from the tested implementation head.

A synthetic research agent had an agent-scoped codex-home/auth.json, no OpenClaw auth profile, no fallback API-key environment variable, and a model-scoped Codex runtime. A real local agent turn returned:

FINAL_AUTH_PROOF_OK sha=f2806c54a7a5c8d6da4fbb90b6315eeef79388ea turn_status=1
AgentHarnessPreflightError: A Codex auth file exists at <state>/agents/research/agent/codex-home/auth.json ...
openclaw migrate plan codex --from <codex-home> --agent research --include-secrets --item auth:openai
openclaw migrate apply codex --from <codex-home> --agent research --include-secrets --item auth:openai --yes

The proof asserted both exact commands, nonzero agent-turn exit, and absence of downstream No API key found, 401 Unauthorized, or synthetic credential values.

Migration and post-migration behavior

Earlier container proof exercised the explicit migration against an existing non-default agent. migrate plan selected the agent's Codex home and auth item; migrate apply --include-secrets --yes populated that agent's SQLite auth_profile_store and auth_profile_state; the default agent remained untouched. After restart, a real managed turn completed with post-migration proof, and the container stayed healthy with zero restarts.

Direct Codex contract check

Direct inspection of OpenAI Codex at d72d669ca727a26765315ffe03db3dd2594d9b91 confirms the dependency behavior:

That is why this PR keeps SQLite as the owner and stops with explicit migration guidance instead of silently reading or importing the legacy file.

Add agent-scoped Codex migration guidance and expose a validated --agent target so non-default credentials cannot be imported into the default agent store.

Fixes openclaw#116763
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation cli CLI command changes commands Command implementations extensions: codex plugin: migrate-hermes plugin: migrate-claude size: M maintainer Maintainer-authored PR labels Jul 31, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. labels Jul 31, 2026
@clawsweeper

clawsweeper Bot commented Jul 31, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed August 1, 2026, 8:37 AM ET / 12:37 UTC.

ClawSweeper review

What this changes

The PR detects managed Codex agents whose legacy agent-scoped auth.json was not imported, shows an exact agent-targeted migration command before a model request, and adds validated --agent and --item migration CLI options.

Merge readiness

⛔ Blocked until stronger real behavior proof is added - 5 items remain

Keep this PR open for maintainer review. The patch appears to address the linked upgrade failure with a narrow early diagnostic and explicit agent-scoped migration path, but this review cannot mark the Codex dependency proof or real-behavior gate sufficient because the repository-required sibling ../codex source checkout is absent; the PR also has the protected maintainer label and still has in-progress checks.

Priority: P1
Reviewed head: a6228bc98bdddbb67aec832ff84d135da039a175

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The patch has focused source and regression coverage, while the remaining independent dependency-contract and exact-head proof gap keeps it below merge-ready.
Proof confidence 🦐 gold shrimp (3/6) Needs stronger real behavior proof before merge: The PR body contains a redacted terminal/Testbox claim for the managed-agent diagnostic and post-migration turn, but this review cannot independently complete the required sibling-Codex contract check because ../codex is absent; attach refreshed redacted terminal or live output after that verification. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs stronger real behavior proof before merge: The PR body contains a redacted terminal/Testbox claim for the managed-agent diagnostic and post-migration turn, but this review cannot independently complete the required sibling-Codex contract check because ../codex is absent; attach refreshed redacted terminal or live output after that verification. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 6 items PR implementation path: The branch resolves the agent auth profile before constructing scoped ephemeral startup options; when no profile resolves, it detects a managed per-agent legacy auth file and raises an actionable preflight error. The API-key fallback remains exempt for API-key routes.
Agent ownership propagation: The branch carries the session agent ID into the shared Codex client start context, so the diagnostic can name the correct target agent rather than silently directing a non-default agent to the default store.
Validated public migration target: The branch validates and normalizes an explicitly selected agent against configured agent IDs before constructing the migration provider context, avoiding typo-created target stores.
Findings None None.
Security None None.

How this fits together

The Codex extension starts a managed local Codex app-server for an agent and supplies authentication from OpenClaw’s agent-scoped SQLite auth store. Migration commands import eligible legacy credentials into that owner store, after which the startup bridge launches the app-server with the resolved auth route.

flowchart LR
  A[Agent Codex request] --> B[Managed app-server startup]
  B --> C[Resolve agent auth route]
  C --> D{Canonical auth or API-key fallback?}
  D -->|Yes| E[Launch with prepared ephemeral auth]
  D -->|No, legacy auth file found| F[Show agent-scoped migration guidance]
  F --> G[Explicit migration command]
  G --> H[Agent SQLite auth store]
Loading

Before merge

  • Add real behavior proof - Needs stronger real behavior proof before merge: The PR body contains a redacted terminal/Testbox claim for the managed-agent diagnostic and post-migration turn, but this review cannot independently complete the required sibling-Codex contract check because ../codex is absent; attach refreshed redacted terminal or live output after that verification. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Resolve merge risk (P2) - The PR changes public migration selection behavior and the early failure mode for existing managed Codex deployments; maintainers need exact-head proof for both upgrade recovery and supported API-key fallback paths.
  • Resolve merge risk (P1) - The branch is behind current main and CI is still in progress, so its merge result and final validation need a refresh before landing.
  • Resolve merge risk (P1) - The required direct sibling-Codex source inspection could not be performed because ../codex is absent; this review therefore cannot independently certify the claimed ephemeral credential-store contract.
  • Complete next step (P2) - The protected maintainer label, compatibility-sensitive auth behavior, incomplete CI, and unavailable sibling-Codex contract inspection require human-owned merge review rather than an automated repair lane.
Agent review details

Security

None.

PR surface

Source +134, Tests +250, Docs +42. Total +426 across 18 files.

View PR surface stats
Area Files Added Removed Net
Source 7 159 25 +134
Tests 8 257 7 +250
Docs 3 48 6 +42
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 18 464 38 +426

Review metrics

Metric Value Why it matters
Public migration controls 2 added CLI selectors: --agent, --item These new selectors affect upgrade recovery ownership and limit which sensitive migration item is applied, so their behavior needs compatibility review.

Stored data model

Persistent data-model change detected: migration/backfill/repair: docs/plugins/codex-harness-reference.md, migration/backfill/repair: docs/providers/openai.md, migration/backfill/repair: extensions/codex/src/app-server/auth-bridge.test.ts, migration/backfill/repair: extensions/codex/src/migration/provider.test.ts, migration/backfill/repair: src/cli/program/register.migrate.test.ts, migration/backfill/repair: src/cli/program/register.migrate.ts, and 4 more. Migration or upgrade compatibility proof is recorded; maintainers should verify it before merge.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #116763
Summary: This PR explicitly targets the upgrade authentication failure described in the canonical open issue; the merged Doctor migration-owner refactor is adjacent but does not replace this runtime diagnostic.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Prove the upgrade boundary before merge (recommended)
    Rebase or refresh the exact head, complete CI, and attach an independently reviewable managed-agent diagnostic plus post-migration success proof with the sibling Codex contract checked.
  2. Pause for owner review
    Pause the PR if the maintainer does not want new public migrate --agent and --item semantics bundled with this recovery path.
Copy recommended automerge instruction
@clawsweeper automerge

Special instructions:
Refresh the exact head after CI completes, verify the managed legacy-auth diagnostic and post-migration turn, and include direct sibling Codex source inspection in the review evidence.

Technical review

Best possible solution:

Keep the early, explicit migration guidance and agent-scoped import boundary, then re-run the exact-head review where sibling Codex source is available and verify fresh-install, upgrade, and both API-key fallback routes before merge.

Do we have a high-confidence way to reproduce the issue?

Unclear for an independently executed current-head run in this review: the PR body provides a redacted managed-agent before/after transcript and source clearly reaches the new preflight branch, but the required local sibling-Codex contract inspection is unavailable.

Is this the best way to solve the issue?

Unclear: the owner-boundary shape is sound because it preserves explicit secret-import consent and avoids reviving a legacy runtime fallback, but the direct Codex ephemeral-store contract and exact-head upgrade proof must be independently checked before calling it the best fix.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 8738fe135461.

Labels

Label justifications:

  • P1: A managed Codex upgrade can leave an otherwise selected model route unable to authenticate until an operator performs recovery.
  • merge-risk: 🚨 compatibility: The PR adds public migration selection semantics and changes the failure behavior seen by existing managed Codex deployments with legacy credentials.
  • merge-risk: 🚨 auth-provider: The changed startup bridge and migration path determine whether OpenAI/Codex credentials resolve for an agent-scoped runtime.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: The PR body contains a redacted terminal/Testbox claim for the managed-agent diagnostic and post-migration turn, but this review cannot independently complete the required sibling-Codex contract check because ../codex is absent; attach refreshed redacted terminal or live output after that verification. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

What I checked:

  • PR implementation path: The branch resolves the agent auth profile before constructing scoped ephemeral startup options; when no profile resolves, it detects a managed per-agent legacy auth file and raises an actionable preflight error. The API-key fallback remains exempt for API-key routes. (extensions/codex/src/app-server/auth-bridge.ts:69, a6228bc98bdd)
  • Agent ownership propagation: The branch carries the session agent ID into the shared Codex client start context, so the diagnostic can name the correct target agent rather than silently directing a non-default agent to the default store. (extensions/codex/src/app-server/shared-client.ts:390, a6228bc98bdd)
  • Validated public migration target: The branch validates and normalizes an explicitly selected agent against configured agent IDs before constructing the migration provider context, avoiding typo-created target stores. (src/commands/migrate/context.ts:35, a6228bc98bdd)
  • Current-main provenance: Current main contains the existing auth-bridge route-resolution behavior from commit 51c41c2; the proposed diagnostic is not already present on main, so this PR remains necessary for the reported recovery experience. (extensions/codex/src/app-server/auth-bridge.ts:96, 51c41c25c8c3)
  • Dependency-proof gate unavailable: Repository policy requires the reviewing agent to inspect sibling Codex source for dependency-backed Codex behavior. ../codex is absent in this read-only checkout, so the claimed ephemeral-store contract cannot be independently confirmed here.
  • Branch/release status: The PR head is not contained by current main and no local release tag contains it; this is an open, unshipped candidate rather than an implemented-on-main cleanup. (a6228bc98bdd)

Likely related people:

  • Peter Steinberger: Current-main blame attributes the relevant auth-bridge startup path to Peter Steinberger, and recent history shows repeated ownership of Codex app-server authentication and runtime work. (role: recent Codex auth-path contributor; confidence: high; commits: 51c41c25c8c3, 1a27e7f3ec2f, 3d6a2216ea77; files: extensions/codex/src/app-server/auth-bridge.ts, extensions/codex/src/app-server/shared-client.ts)
  • Vincent Koc: History shows a prior Codex compatibility repair for legacy app-server auth provider aliases, making this person a relevant adjacent reviewer for the upgrade boundary. (role: adjacent auth compatibility contributor; confidence: medium; commits: 9a7e0d43daf6; files: extensions/codex/src/app-server/auth-bridge.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Complete the exact-head CI run and refresh the behind-main review context.
  • Provide or preserve redacted terminal/live output for the pre-migration diagnostic and successful agent-scoped post-migration turn.
  • Re-run the dependency review from an environment containing sibling ../codex source.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (10 earlier review cycles; latest 8 shown)
  • reviewed 2026-08-01T06:53:54.660Z sha fb51345 :: needs real behavior proof before merge. :: [P1] Get approval for the new public harness recovery hook
  • reviewed 2026-08-01T07:46:39.212Z sha c6660c8 :: needs real behavior proof before merge. :: [P1] Preserve API-key fallback before migration guidance
  • reviewed 2026-08-01T07:55:11.481Z sha c6660c8 :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-01T08:07:37.570Z sha 955f339 :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-01T08:23:05.948Z sha 194c7d6 :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-01T11:12:31.060Z sha f2806c5 :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-01T11:22:24.818Z sha 9968708 :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-01T12:24:16.316Z sha 409d495 :: needs real behavior proof before merge. :: none

@jacobtomlinson
jacobtomlinson requested a review from a team as a code owner July 31, 2026 16:46
@openclaw-barnacle openclaw-barnacle Bot added the agents Agent runtime and tooling label Jul 31, 2026
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Jul 31, 2026
@jacobtomlinson

Copy link
Copy Markdown
Contributor Author

Real-behavior proof is now recorded in the PR body. Here is the complete redacted result and its boundary.

Environment identity

  • PR head: fb513458ae0147a0326390d5c509ad1c9be96e02
  • Image tag: openclaw:pr-116807-fb513458ae0
  • Image ID: sha256:21d2885f5728adfd16e8904e7c768c11c47f12c5b4b9a42bb9441966c87e9a9c
  • Runtime reported: OpenClaw 2026.7.2 (fb51345)
  • Target: an existing non-default agent (local identifier redacted)

Pre-migration state

  • The selected agent's SQLite auth store had no route-compatible OpenAI authentication.
  • The existing agent-scoped Codex credential file was present, owned by the container user, and mode 0600.
  • The credential contained ChatGPT auth material and no API key. No token, account identifier, or credential value was printed or copied into this comment.
  • The observed managed-run failures were:
    • No API key found for provider "openai". Auth store: .../<agent>/agent/openclaw-agent.sqlite
    • No route-compatible authentication source is configured for openai.

Plan and apply

The read-only plan targeted the named agent and completed with:

total: 4
planned: 2
skipped: 2
errors: 0
sensitive: 1

The planned actions were the OpenAI auth import into the selected agent's canonical auth store and archival of the migrated Codex config. Cached plugin bundles were skipped. An unrelated plugin-list timeout warning did not prevent planning or applying the migration.

The applied command was:

docker exec <container> openclaw migrate apply codex \
  --agent <non-default-agent> \
  --from <agent-codex-home> \
  --include-secrets --yes

The migration succeeded and populated both auth_profile_store and auth_profile_state in the selected agent's SQLite database. This directly verifies that --agent <non-default-agent> writes to that agent rather than the default agent.

Post-migration behavior

  • A real managed agent turn completed with the exact response post-migration proof.
  • The container was healthy with zero restarts.
  • The revised image selection remained persisted across restart.
  • A separate Mattermost plugin incompatibility (formatInboundEnvelope is not a function) was unrelated to Codex authentication; the managed CLI turn bypassed channel delivery and proved the auth/runtime path directly.

Proof boundary

This run proves the real upgrade recovery path from missing canonical auth, through explicit named-agent migration, to a successful managed Codex turn.

It does not prove the new actionable pre-migration diagnostic text. At the time of the pre-migration failure, the container was loading an older globally installed Codex plugin (2026.7.1-1) that overrode the revised runtime. The standard core Docker image intentionally excludes the externalized Codex plugin. The installed plugin was later aligned to published 2026.7.2-beta.5, but migration had already completed, and that published artifact is not this PR's 2026.7.2 plugin package. Claiming the new diagnostic was exercised would therefore be inaccurate.

Direct dependency contract

I also inspected OpenAI Codex directly at d72d669ca727a26765315ffe03db3dd2594d9b91:

This confirms there is no dependency-level implicit fallback from managed ephemeral auth to the old agent-scoped auth.json; explicit migration into OpenClaw's canonical store is required.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Aug 1, 2026
@fuller-stack-dev fuller-stack-dev self-assigned this Aug 1, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the agents Agent runtime and tooling label Aug 1, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Aug 1, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Aug 1, 2026

@fuller-stack-dev fuller-stack-dev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maintainer review on exact head 194c7d6: approved.

I accept the explicit recovery boundary and the public --agent/--item migration surface. This does not auto-import legacy Codex secrets: managed local stdio startup fails before a model request only when canonical agent auth and supported API-key fallbacks are absent, and the operator must explicitly run migrate --include-secrets --item auth:openai for the validated agent.

Direct dependency check at openai/codex d72d669ca727a26765315ffe03db3dd2594d9b91 confirmed ephemeral storage is memory-only (codex-rs/config/src/types.rs:87, codex-rs/login/src/auth/storage.rs:455, codex-rs/login/src/auth/manager.rs:1230). Exact-head Testbox run 30691298503 exercised the real named-agent CLI path and produced the scoped preflight commands without a downstream 401; CODEX_API_KEY and OPENAI_API_KEY fallback regressions pass. Hosted CI and CodeQL are green. ClawSweeper found no actionable code or security findings; its remaining proof warning is an access limitation in that reviewer environment, not an unmet product proof item.

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Aug 1, 2026
@fuller-stack-dev

Copy link
Copy Markdown
Member

@clawsweeper re-review

@fuller-stack-dev fuller-stack-dev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maintainer approval refreshed on exact head f2806c5 after current-main integration. Direct Codex inspection at d72d669ca727a26765315ffe03db3dd2594d9b91 confirms ephemeral auth is memory-only (codex-rs/config/src/types.rs:87, codex-rs/login/src/auth/storage.rs:455, codex-rs/login/src/auth/manager.rs:1230). Exact-head Testbox run 30697086713 built OpenClaw f2806c5 and exercised a real named-agent turn: it failed before provider I/O with only the validated --agent research --include-secrets --item auth:openai commands, with no downstream 401 or secret disclosure. API-key fallback regressions pass. The public boundary is accepted: no automatic import and no runtime file fallback; SQLite stays canonical and secret migration requires explicit operator consent.

@clawsweeper

clawsweeper Bot commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

@fuller-stack-dev fuller-stack-dev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Owner decision on exact landing head 9968708: approved. ClawSweeper reports no findings and no security issues; its sole remaining rank-up move is satisfied by direct sibling ../codex inspection at d72d669ca727a26765315ffe03db3dd2594d9b91. Ephemeral storage is memory-only in codex-rs/config/src/types.rs:87-100 and codex-rs/login/src/auth/storage.rs:455-524; empty ephemeral auth has no persisted-file fallback in codex-rs/login/src/auth/manager.rs:1230-1277. Blacksmith Testbox proved the unchanged auth implementation at f2806c5 on a real named-agent turn. The only f2806c5..9968708 movement is upstream cron child-delivery commit e9e4023, with no Codex/auth/migration/CLI/config/shared-lifecycle overlap and an unchanged 17-file PR diff. I accept the explicit-consent boundary: no automatic secret import and no runtime auth-file fallback; SQLite remains canonical.

@fuller-stack-dev fuller-stack-dev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maintainer approval refreshed on exact head cb76775 after merging current upstream main through 142ad75. The intervening doctor auth refactor (#117361) does not touch this PR’s startup bridge, explicit migration CLI, or fixtures; 226 focused exact-head tests and a fresh clean autoreview (0.97, TruffleHog clean) confirm the unchanged 17-file diff. Direct Codex inspection at d72d669ca727a26765315ffe03db3dd2594d9b91 confirms ephemeral storage is memory-only in codex-rs/config/src/types.rs:87-100 and codex-rs/login/src/auth/storage.rs:455-524, with no persisted fallback from empty ephemeral auth in codex-rs/login/src/auth/manager.rs:1230-1277. Testbox run 30697086713 proves the explicit named-agent preflight boundary. I accept the consent boundary: no automatic secret import or runtime auth-file fallback; SQLite remains canonical.

@fuller-stack-dev fuller-stack-dev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maintainer approval refreshed on exact head 409d495. The 17-file auth/migration/docs change remains byte-for-byte unchanged from the Testbox-proven implementation; the only added line makes the dedicated TUI PTY Vitest config report per-test progress so the current low-core fork-PR path cannot kill valid work at its 120-second no-output watchdog. That CI failure reproduced three times, while the same tests passed with verbose progress; exact-head harness proof is 49/49. Fresh complete-branch autoreview is clean (0.98; TruffleHog clean). Direct Codex inspection at d72d669ca727a26765315ffe03db3dd2594d9b91 still confirms the accepted boundary: ephemeral auth is memory-only with no persisted fallback, and secret import remains explicit and agent-scoped.

@fuller-stack-dev fuller-stack-dev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maintainer approval refreshed on exact head a6228bc. The only movement from reviewed head 409d495 is upstream main PR #117399 under extensions/xai; it does not touch or call the 18-file auth/migration/TUI-reporter diff, so the clean branch autoreview, 226 focused auth tests, 66/66 hosted built-CLI PTY proof, direct Codex contract inspection, and accepted explicit-consent boundary remain valid.

@fuller-stack-dev
fuller-stack-dev merged commit 20ac22f into openclaw:main Aug 1, 2026
191 of 196 checks passed
@fuller-stack-dev

Copy link
Copy Markdown
Member

Merged via squash.

@jacobtomlinson
jacobtomlinson deleted the fix/codex-auth-migration-116763 branch August 1, 2026 17:59
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 2, 2026
* fix(codex): diagnose unimported agent auth

Add agent-scoped Codex migration guidance and expose a validated --agent target so non-default credentials cannot be imported into the default agent store.

Fixes openclaw#116763

* fix(codex): surface auth migration before route planning

* fix(codex): scope auth migration recovery

* fix(codex): preserve API key auth fallback

* test: repair memory importer routing expectation

* test: drop superseded memory routing repair

* test(tui): report PTY progress verbosely

---------

Co-authored-by: fuller-stack-dev <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes commands Command implementations docs Improvements or additions to documentation extensions: codex maintainer Maintainer-authored PR merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P1 High-priority user-facing bug, regression, or broken workflow. plugin: migrate-claude plugin: migrate-hermes rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: M status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Mounted Codex auth.json is not imported on upgrade from 2026.6.1 to 2026.7.2-beta.5

2 participants