fix(status): use legacy Codex OAuth profiles for OpenAI usage#90356
fix(status): use legacy Codex OAuth profiles for OpenAI usage#90356sovushik wants to merge 1 commit into
Conversation
|
Observed locally on OpenClaw 2026.6.1:
This PR keeps Local verification: |
|
Codex review: needs maintainer review before merge. Reviewed July 6, 2026, 3:44 PM ET / 19:44 UTC. Summary PR surface: Source +26, Tests +24. Total +50 across 4 files. Reproducibility: yes. at source/proof level. Current main only resolves canonical Review metrics: 1 noteworthy metric.
Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Maintainer decision needed
Security Review detailsBest possible solution: If maintainers approve the compatibility exception, land a refreshed branch that keeps legacy-profile lookup usage-only and separate from synthetic Codex app-server usage; otherwise keep doctor-only migration behavior. Do we have a high-confidence way to reproduce the issue? Yes at source/proof level. Current main only resolves canonical Is this the best way to solve the issue? Conditionally yes: the diff is a narrow compatibility fix at the provider-usage auth seam, but the stricter architecture alternative is to require AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against e9464313b728. Label changesLabel justifications:
Evidence reviewedPR surface: Source +26, Tests +24. Total +50 across 4 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
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. How this review workflow works
|
71c4cc6 to
d9b3358
Compare
|
Update after testing the local reproduction more deeply: The first fix covered auth collection fallback, but the real provider-usage plugin path still dropped the legacy credential because the plugin explicitly calls Local proof from the affected Mac mini:
Tested with: |
|
Added the requested end-to-end status proof from the patched branch. Patched branch proof: I also verified the legacy-only credential shape explicitly by creating a temporary agent auth store containing only an Local regression tests still pass: One operational note from the affected Mac mini: before this proof, the real local install still had auth in legacy JSON storage. Running the official @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
This pull request has been automatically marked as stale due to inactivity. |
Summary
openai-codexOAuth/token profiles to the canonicalopenaiusage provideropenai-codex:*credentials when collectingopenaiChatGPT usage, including plugins that explicitly requestresolveOAuthToken({ provider: "openai" })Context
After the OpenAI/Codex provider migration, a user can still have a healthy legacy
openai-codex:*OAuth profile whileopenclaw status --usagenow asks the usage collector for provideropenai. In that state the ChatGPT WHAM usage endpoint works with the stored token, butopenclaw status --usage --jsonreportsusage.providers: []/Usage: no provider usage available.This preserves the new canonical
openaiusage provider while making usage auth backward-compatible with existingopenai-codexOAuth/token profiles until users run doctor/migration.Real behavior proof
openclaw status --usagereturned no provider usage when the only live ChatGPT OAuth profile was stored under the legacyopenai-codex:*provider id.openai-codex:*, OAuth, account id present).openai-codexOAuth token to the canonical OpenAI usage endpoint:/Users/cyberowl/.openclaw/workspace/scripts/codex-usage-status.sh.openai-codex:*OAuth profile produced live ChatGPT WHAM usage windows for 5h and Week instead ofusage.providers: []. The branch makes the built-in usage auth resolver use that legacy profile for canonicalopenaiusage, including the plugin path that explicitly asks forresolveOAuthToken({ provider: "openai" }).openai:*profile; the existing behavior for canonical profiles is covered by current paths and the added regression tests focus on the legacy profile compatibility.Tests
CI=true pnpm vitest run src/infra/provider-usage.shared.test.ts src/infra/provider-usage.auth.normalizes-keys.test.ts