-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Codex re-auth updates managed credentials but matching system account keeps using revoked token #3558
Copy link
Copy link
Closed
Labels
P0Emergency: data loss, security bypass, crash loop, or unusable core runtime.Emergency: data loss, security bypass, crash loop, or unusable core runtime.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:auth-providerThis issue is about auth, provider routing, model choice, or SecretRef resolution.This issue is about auth, provider routing, model choice, or SecretRef resolution.impact:ux-release-blockerA non-technical user is blocked without terminal, logs, config, or support.A non-technical user is blocked without terminal, logs, config, or support.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Description
Activity
Metadata
Metadata
Assignees
Labels
P0Emergency: data loss, security bypass, crash loop, or unusable core runtime.Emergency: data loss, security bypass, crash loop, or unusable core runtime.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:auth-providerThis issue is about auth, provider routing, model choice, or SecretRef resolution.This issue is about auth, provider routing, model choice, or SecretRef resolution.impact:ux-release-blockerA non-technical user is blocked without terminal, logs, config, or support.A non-technical user is blocked without terminal, logs, config, or support.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Summary
On CodexBar 0.58.0 (141), a saved Codex account that also matches the system Codex login stays at Needs re-auth after repeated successful reauthentication through CodexBar settings.
Reauthentication produces a valid credential in CodexBar's managed account home, but the visible account continues using the revoked credential in
~/.codex/auth.json. Selecting OAuth API as the quota usage source does not resolve the mismatch.Environment
Reproduction observed
Diagnostic evidence
The saved account snapshot used
selectionSource.kind = liveSystem, with a different credential fingerprint from the managed account's fresh login.Read-only GET requests to
https://chatgpt.com/backend-api/wham/usage, using the respective existing credentials and the same account header, returned:~/.codex/auth.jsontoken_revoked:Encountered invalidated oauth token for user, failing requestauth.jsonThe system access token was issued September 1, 2026 and expired September 11. The managed credential was issued September 11 and expires September 21. No refresh-token redemption was attempted during this comparison.
Relevant implementation
In
Sources/CodexBarCore/Providers/Codex/CodexVisibleAccountProjection.swift, the matching live-system account replaces the managed account draft withselectionSource: .liveSystemand the live credential fingerprint, while retaining the saved account ID and reauthentication capability.ManagedCodexAccountService.authenticateManagedAccountauthenticates into a new managed home and updates the stored account. This appears to leave the visible account reading a different credential than the one just renewed.The live-system projection preference is also present in the v0.59.0 source; runtime reproduction was on v0.58.0 only.
Expected behavior
After successful reauthentication of a visible account, its usage fetch should use the newly authenticated credential. If repairing the system login requires separate consent, the UI should explain that and offer the appropriate action instead of repeatedly renewing an unused credential.
Verified local repair
After backing up the system auth file, replaced it atomically with the already-working managed auth file for the same account. CodexBar CLI usage with
--provider codex --source oauththen succeeded, and the user confirmed the menu recovered.No security setting changes or additional sign-in were necessary.
Potentially related: #3523 / #3534 concern renewal guidance, but this report specifically concerns reauthentication updating one credential while the visible account continues using another.