CodexBar icon indicating copy to clipboard operation
CodexBar copied to clipboard

Claude OAuth token expired, but background repair is suppressed when Keychain prompt policy

Open brettstark73 opened this issue 4 months ago • 2 comments

Claude OAuth token expired, but background repair is suppressed when Keychain prompt policy is set to only prompt on user action. Click Refresh in the CodexBar menu to retry.

I continually get this error but have set the right setting in keychain - codexbar seems to create a new entry in keychain with the wrong settng - 'confirm ... '.

brettstark73 avatar Jul 31 '26 15:07 brettstark73

Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed August 2, 2026, 3:15 PM ET / 19:15 UTC.

Summary Keep this issue open for maintainer-supported diagnosis. Current main deliberately suppresses opaque delegated Claude CLI repair during background refresh when the stored policy is “Only on user action,” while preserving user-initiated repair; the remaining report that CodexBar created a Keychain item with an incorrect policy is not established without the affected item identity and an observed Refresh result.

Reproducibility: no. Current source and focused tests reproduce the intended distinction between background suppression and user-initiated recovery, but the issue lacks the Keychain service/account/access-control details and a redacted explicit-Refresh result needed to reproduce an incorrect item policy.

Ways to help us reproduce this

  • Add a screenshot or short recording showing the behavior.
  • Add expected vs actual behavior.
  • Share version, platform, channel/provider, and relevant config details.

Maintainer decision needed

Question Recommendation
Should explicit Refresh remain the sole path that may invoke delegated Claude recovery under “Only on user action,” and, if the reported record is CodexBar’s own cache, what Keychain access-control behavior should that cache promise? Preserve the current boundary and diagnose the record: Keep background repair suppressed and request the service, account, access-control details, and redacted explicit-Refresh outcome before changing any Keychain behavior.

Why: The current implementation and documentation intentionally protect background refresh from opaque Keychain interaction; VISION.md requires sign-off for provider-auth and data-storage behavior changes, and the report does not yet identify a concrete incorrect record.

Next step Needs a maintainer decision on the auth-interaction boundary and concrete evidence identifying the purported Keychain record; a speculative repair PR could weaken the documented background-safety behavior.

Review details

Best possible solution:

Keep the current fail-closed background policy, collect the affected Keychain item’s service/account/access-control details plus a redacted explicit-Refresh result, and only change cache or recovery behavior through an approved narrow auth/storage decision.

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

No. Current source and focused tests reproduce the intended distinction between background suppression and user-initiated recovery, but the issue lacks the Keychain service/account/access-control details and a redacted explicit-Refresh result needed to reproduce an incorrect item policy.

Is this the best way to solve the issue?

Unclear. The existing guard is the documented, release-shipped solution for background prompting; a change to Keychain cache or delegated recovery is not the best solution until the affected record and expected ownership are established.

AGENTS.md: found and applied where relevant.

Remaining risk / open question:

  • Changing the background guard without identifying the exact Keychain item could re-enable background prompts or opaque delegated CLI interaction that the current privacy boundary intentionally prevents.
  • The reported Keychain-policy mismatch may concern CodexBar’s OAuth cache, Claude Code’s credentials item, or a different Keychain record; treating those as the same storage owner could produce an unsafe fix.

Codex review notes: model internal, reasoning high; reviewed against 8cf2963c135d.

Label changes

Label justifications:

  • P2: The issue affects Claude OAuth recovery but current main provides a documented manual recovery path, so the present evidence does not show an urgent outage.
  • impact:auth-provider: The report concerns expired Claude OAuth credentials, Keychain access, and delegated provider recovery.
  • impact:ux-friction: The suppression message and unclear Keychain record add recovery confusion, but explicit Refresh and claude login remain available paths.
Evidence reviewed

What I checked:

Likely related people:

  • Ratul Sarna: Local history identifies the original Claude Keychain prompt-policy and delegated-refresh work, including the policy introduction and follow-up interaction semantics. (role: original policy-area contributor; confidence: high; commits: 0e7da356a37f, 879294e9c220, bf170339bdb3; files: Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthDelegatedRefreshCoordinator.swift, Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthKeychainPromptMode.swift)
  • Yuxin Qiao: Merged commit a27c9b094e618dfaee9ba395fe4715249ec64c0b implemented the related background delegated-refresh guard, and subsequent history includes a stored-prompt-policy follow-up. (role: introduced current background-repair safeguard; confidence: high; commits: a27c9b094e61, 47120d4a03b4, d686b4bdbbd7; files: Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthDelegatedRefreshCoordinator.swift, Tests/CodexBarTests/ClaudeOAuthCredentialsStorePromptPolicyTests.swift)
  • Peter Steinberger: Current-file blame attributes the reviewed coordinator content to the v0.46.0 release update, and local history shows repeated integration work on the active Claude path. (role: recent current-main and release contributor; confidence: medium; commits: b1170d83963d, 5b53021f1c97; files: Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthDelegatedRefreshCoordinator.swift, docs/claude.md)
How this review workflow works
  • 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.

clawsweeper[bot] avatar Jul 31 '26 16:07 clawsweeper[bot]

Resolved by #2585: background repair remains prompt-safe by design under "Only on user action", while an explicit Refresh now hands expired Claude-owned credentials to the Claude CLI without reading or recreating a foreign Keychain item.

steipete avatar Aug 02 '26 20:08 steipete