Repository navigation
Conversation
|
Codex review: needs real behavior proof before merge. Summary Reproducibility: yes. Source inspection gives a high-confidence path: a Codex app-server forced refresh with a persisted OAuth credential on current main writes Real behavior proof Next step before merge Security Review detailsBest possible solution: Land this focused auth-profile fix after the contributor supplies real behavior proof and exact-head targeted validation passes. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection gives a high-confidence path: a Codex app-server forced refresh with a persisted OAuth credential on current main writes Is this the best way to solve the issue? Yes. Removing the unlocked temporary stale write and routing forced refresh through the existing locked OAuth resolver/manager path is the narrow maintainable fix; the remaining blocker is proof/validation, not a different design. What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 386d321634b3. |
2983612 to
1af02b3
Compare
|
Updated in Changes since the review:
Local targeted validation, without a full workspace install:
I also updated the PR body with the new behavior proof. Re-review progress:
|
1af02b3 to
a149d7d
Compare
a149d7d to
232056f
Compare
232056f to
1c1e641
Compare
Treat forced OAuth refresh as a hard refresh contract: fallback credentials may be reused only when they changed after the attempted refresh began. Co-authored-by: Clever <[email protected]>
1c1e641 to
70083f2
Compare
|
@clawsweeper re-review I updated the Real behavior proof section with a redacted local OpenClaw runtime probe. It runs the real Re-review progress:
|
|
🦞🧹 Reason: re-review requires an open issue or PR. |
Treat forced OAuth refresh as a hard refresh contract: fallback credentials may be reused only when they changed after the attempted refresh began. Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: Clever <[email protected]>
Treat forced OAuth refresh as a hard refresh contract: fallback credentials may be reused only when they changed after the attempted refresh began. Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: Clever <[email protected]>
Treat forced OAuth refresh as a hard refresh contract: fallback credentials may be reused only when they changed after the attempted refresh began. Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: Clever <[email protected]>
Summary
expires: 0credential.forceRefreshas a hard refresh contract: after a refresh failure, fallback credentials are reusable only if they changed after the attempted refresh began.account/chatgptAuthTokens/refreshcannot be satisfied by the same unchanged access token.Real behavior proof
Behavior addressed: Codex external
chatgptAuthTokensrefresh requests now perform a real OAuth refresh attempt and do not reuse unchanged inherited auth-profile tokens after refresh failure.Real environment tested: Local OpenClaw checkout on branch
fix/codex-auth-refresh-no-stale-expiry, rebased onto currentorigin/main, commit1c1e64109acdb16846a252b54722cd4763ae634b.Exact steps or command run after this patch:
pnpm test src/agents/auth-profiles/oauth.mirror-refresh.test.ts src/agents/auth-profiles/oauth.openai-codex-refresh-fallback.test.ts extensions/codex/src/app-server/auth-bridge.test.tsandgit diff --check origin/main...HEAD.Evidence after fix: Copied live terminal output from a local OpenClaw runtime probe on the PR branch after the patch. The probe uses a temporary
OPENCLAW_STATE_DIRandOPENCLAW_AGENT_DIR, loads the realcreateOAuthManagerimplementation withnode --import tsx, seeds a redactedopenai-codexOAuth profile, callsresolveOAuthAccess(..., forceRefresh: true), and prints only redacted booleans/results:Supplemental exact-head validation output from the same checkout:
Observed result after fix: The runtime probe shows forceRefresh enters the refresh path for an otherwise unexpired openai-codex OAuth profile, returns a rotated access token, and leaves persisted_expires_zero=false. The previous inline
expires: 0persistence path is gone; if refresh fails, unchanged local/main-store fallback access is rejected, while genuinely changed credentials from another completed refresh can still be reused.What was not tested: A live OpenAI OAuth token rotation with real user credentials was not run to avoid using live auth material in PR proof. Broad
pnpm check:changedwas attempted, delegated to Testbox, then stopped while still queued afterorigin/mainmoved and the PR had to be rebased.Validation
pnpm test src/agents/auth-profiles/oauth.mirror-refresh.test.ts src/agents/auth-profiles/oauth.openai-codex-refresh-fallback.test.ts extensions/codex/src/app-server/auth-bridge.test.tsgit diff --check origin/main...HEAD