Fix Claude never-prompt Keychain cache bypass (#1991) - #2011
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 9, 2026, 2:11 PM ET / 18:11 UTC. Summary Reproducibility: yes. source-backed: the linked issue includes affected-machine diagnostics, and current main reads the CodexBar-owned Claude OAuth cache before file fallback even when prompt mode is Review metrics: 2 noteworthy metrics.
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:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Maintainer decision needed
Security Review detailsBest possible solution: Land the focused cache-bypass fix after redacted affected-app runtime proof or an explicit maintainer proof override confirms that Do we have a high-confidence way to reproduce the issue? Yes, source-backed: the linked issue includes affected-machine diagnostics, and current main reads the CodexBar-owned Claude OAuth cache before file fallback even when prompt mode is Is this the best way to solve the issue? Yes for the code shape: gating the Claude-specific CodexBar cache above AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 3b039d15e125. Label changesLabel justifications:
Evidence reviewedWhat 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
Review history (4 earlier review cycles)
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8a42ab76ef
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f37327eabd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 38a399deac
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3c340b40d3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Addressed all seven @chatgpt-codex-connector P2 inline comments in commits Updated the PR body with redacted macOS behavior proof from isolated test-keychain runs (no live Keychain UI per @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Live macOS behavior proof (#1991 / #2025)Reproduced on a local machine against the installed Homebrew/Sparkle app Setup
/Applications/CodexBar.app/Contents/Helpers/CodexBarCLI usage --provider claude --source oauthResult
Repro helperAdded a small helper script on my branch: ./Scripts/repro_keychain_issues.sh 2025It seeds the cache, switches to Notes
|
|
@clawsweeper re-review — added live macOS repro proof in the previous comment and pushed |
|
🦞🧹 I asked ClawSweeper to review this item again. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4a41e5823d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3cb19cc030
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
When users choose Avoid Keychain prompts, skip CodexBar-owned oauth.claude cache and Claude keychain presence probes that could still trigger macOS Keychain UI during background refresh. Co-authored-by: Cursor <cursoragent@cursor.com>
Do not save the file fingerprint while CodexBar OAuth Keychain cache work is skipped, so switching back to a prompt-enabled mode can clear stale oauth.claude entries before load. Co-authored-by: Cursor <cursoragent@cursor.com>
Defer explicit invalidateCache keychain deletes while Keychain prompts are disabled, then flush the stale oauth.claude entry before the next prompt-enabled load. Co-authored-by: Cursor <cursoragent@cursor.com>
Skip keychain-derived memory cache under never prompt, save credentials-file fingerprints while deferring keychain clears, and align ownership tests. Co-authored-by: Cursor <cursoragent@cursor.com>
Retry tombstone flushes until keychain delete succeeds, fall back to the credentials file while pending, and keep MCP-only detection for the experimental security CLI reader under stored never prompt mode. Co-authored-by: Cursor <cursoragent@cursor.com>
Flush deferred clears before writing, clear the tombstone only after storeResult succeeds, and re-mark pending when replacement fails. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Treat stale oauth.claude cache as absent when a never-mode pending clear flush fails, and make the live repro helper restore credentials, prompt mode, and keychain cache instead of deleting user state. Co-authored-by: Cursor <cursoragent@cursor.com>
Write prompt mode to both app and CLI defaults domains, restore oauth cache ACLs and browser-cookie cooldown state, and propagate repro misses in all mode. Co-authored-by: Cursor <cursoragent@cursor.com>
873170d to
fc05fd0
Compare
|
ClawSweeper status: review started. I am starting a fresh review of this pull request: Fix Claude never-prompt Keychain cache bypass (#1991) This is item 1/1 in the current shard. Shard 0/1. This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking. Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted. |
# Conflicts: # CHANGELOG.md
|
ClawSweeper status: review started. I am starting a fresh review of this pull request: Fix Claude never-prompt Keychain cache bypass (#1991) This is item 1/1 in the current shard. Shard 0/1. This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking. Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted. |
Summary
never(Avoid Keychain prompts), CodexBar no longer reads/writes/clears the CodexBar-ownedoauth.claudeKeychain cache during OAuth load, invalidation, or cache presence checks.nevernow prefers~/.claude/.credentials.json(and existing Claude-keychain paths governed by the never policy) instead of repeatedly touching the CodexBar OAuth cache item that can surface macOS prompts.never, so a prior prompt-enabled load cannot keep serving staleoauth.claudecache data after the user switches modes.neverrecords the pending marker and flushes it once prompt-enabled cache access is safe again (retrying on locked-keychain failures).security(1)reader (effectiveMode(readStrategy:)), while Security.framework probes remain blocked under storednever.Claude Code-credentialsare skipped when stored prompt mode isnever.ClaudeOAuthCredentialsStoreNeverPromptCacheTestsplus updates to ownership / security-CLI suites.Fixes the bug reported in #1991 where periodic refresh could still trigger macOS Keychain UI even after choosing Avoid Keychain prompts. #1990 (manual-refresh pre-alert UX) is intentionally unchanged.
Codex review follow-ups
clearCacheKeychain()recordspendingCodexBarOAuthKeychainCacheClearundernever; flush on re-enable (28f7c02b, tests)shouldUseCodexBarOAuthKeychainCachegates memory + cache reads (3c340b40, tests)load record ignores codexbar cache in never prompt mode; prior assertion moved to.onlyOnUserAction(e5ca4498)shouldSaveFileFingerprintundernever+ idempotent secondinvalidateCacheIfCredentialsFileChanged()(3c340b40, tests)flushPendingCodexBarOAuthKeychainCacheClearIfNeeded()retains tombstone on.failed; load returns.temporarilyUnavailable(e5ca4498, tests)effectiveMode(readStrategy:)inisMcpOAuthOnlyClaudeKeychainPayloadPresent(e5ca4498, tests)saveToCacheKeychainclears tombstone only after successfulstoreResult(28f7c02b, tests)Behavior proof (redacted, no live Keychain UI)
Repo policy (
AGENTS.md) avoids live macOS Keychain prompt validation in CI/agents. Proof below is from isolated test-keychain runs on macOS 15 using per-testKeychainCacheStore.withServiceOverrideForTesting(no user Keychain prompts).Representative redacted logs from the never-prompt suite:
The second line is from the simulated
errSecInteractionNotAllowedretry path; underneverthe productionoauth.claudeitem is not consulted until the pending clear succeeds.Live macOS repro (installed app 0.41.0)
On a real setup against the installed
0.41.0 (100)app (not just isolated tests):oauth.claudeundercom.steipete.codexbar.cacheclaudeOAuthKeychainPromptMode = neverCodexBarCLI usage --provider claude --source oauthObserved: CLI hung for
>=12swaiting for macOS Keychain UI whilenevermode was active.Helper script (added in
4a41e582):Details: #2011 (comment)
Test plan
swift test --filter 'ClaudeOAuthCredentialsStoreNeverPromptCacheTests|ClaudeOAuthCredentialsStoreTests|ClaudeOAuthCredentialsStorePromptPolicyTests|ClaudeOAuthCredentialsStoreCLIStorageOwnershipTests|ClaudeOAuthCredentialsStoreIsolatedSecurityCLITests'make check(lint green on latest CI rollup)0.41.0app +Scripts/repro_keychain_issues.shMaintainer-requested live proof is in the PR comment above; isolated tests remain the default CI path per
AGENTS.md.