fix: Disable Keychain — Cursor/Claude refresh, Claude boot, overview Weekly - #2426
Conversation
Cursor refreshes failed with “session changed” because Keychain store/load could not persist under Disable Keychain access. Use an in-process fallback and clear it when the setting is toggled. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Clock rollover tests called selectDays(7) on UserDefaults.standard, which leaked into later ControllerTests and, once wall-clock moved past the Jul 15 fixtures, made totalCost nil under a 7-day window. Co-authored-by: Cursor <cursoragent@cursor.com>
Local test build: keep in-memory cookie caches when Keychain is disabled, and ignore Claude Fable/scoped weeklies on the overview switcher bar. Co-authored-by: Cursor <cursoragent@cursor.com>
Background Auto previously gated off Claude CLI whenever Keychain access was disabled, so cold start had no OAuth/web cookies and no CLI until a manual Refresh. Keep CLI available on that path and skip auth-status preflight so boot does not probe Keychain via the child process. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7d289a2c10
ℹ️ 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".
Use isExplicitlyDisabled so the DEBUG test-process Keychain block does not unlock background Auto CLI. Update the characterization test to expect CLI availability when Keychain access is explicitly disabled. Co-authored-by: Cursor <cursoragent@cursor.com>
|
CI failures: characterization tests expected background Auto CLI to stay gated when Keychain is disabled. Fixed by scoping the boot exception to |
|
Codex review: needs real behavior proof before merge. Reviewed July 28, 2026, 2:19 AM ET / 06:19 UTC. ClawSweeper reviewWhat this changesThis PR keeps cookie session caches in process while CodexBar Keychain access is disabled, allows Claude background CLI refresh after a login-status probe in that mode, and incorporates the account-Weekly overview behavior from related work. Merge readiness⛔ Blocked until real behavior proof is added - 9 items remain Keep this PR open for maintainer review. Its cache fallback is narrowly tested, and the Claude overview portion is already covered by the merged related PR, but the remaining disabled-Keychain Claude CLI exception still changes a security-sensitive boundary without proving the spawned CLI will avoid macOS Keychain access. Priority: P1 Review scores
Verification
How this fits togetherCodexBar collects provider usage through browser cookies, OAuth credentials, and provider CLIs, then presents condensed usage in the menu bar. This PR changes the fallback paths used when the user disables CodexBar Keychain access and affects Cursor session refresh plus Claude startup refresh. flowchart LR
Settings[Advanced Keychain setting] --> Gate[Keychain access gate]
Gate --> Cache[In-process cookie cache]
Cache --> Cursor[Cursor refresh]
Gate --> Claude[Claude background refresh]
Claude --> Login[Noninteractive login probe]
Login --> Usage[Claude usage]
Usage --> Overview[Menu-bar overview]
Decision needed
Why: This is a user-facing privacy and credential-boundary contract rather than a purely mechanical implementation choice; the current probe confirms login state but not the credential storage used by the spawned process. Before merge
Findings
Agent review detailsSecurityNeeds attention: The PR changes a credential-boundary path by allowing an external Claude CLI to run automatically while the user has disabled Keychain access. Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the cookie-only in-process fallback, but preserve the background Claude CLI gate until maintainers approve the setting’s scope and there is a supported proof that the allowed path cannot access or prompt through macOS Keychain; then add redacted real-runtime proof for all three reported behaviors. Do we have a high-confidence way to reproduce the issue? No high-confidence live reproduction is included. The code and tests make the cache and background-availability paths source-reproducible, but the PR has no redacted runtime proof from a real disabled-Keychain app session. Is this the best way to solve the issue? No. The in-process cookie cache is a narrow solution, but allowing the external Claude CLI based only on login status does not establish that the disabled-Keychain boundary is preserved. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 0611e8e634c8. LabelsLabel justifications:
EvidenceSecurity concerns:
What I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
# Conflicts: # CHANGELOG.md
|
ClawSweeper status: review started. I am starting a fresh review of this pull request: fix: Disable Keychain — Cursor/Claude refresh, Claude boot, overview Weekly 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. |
|
Merged after full verification, with the two owner-required constraints implemented on top of the original branch: the in-process fallback while Keychain access is disabled is scoped to cookie-cache keys only (Claude OAuth material is never retained in RAM), and background Claude CLI launches are gated behind a noninteractive availability check — background Auto cannot spawn a |
Summary
Fixes #2425
Supersedes/extends #2409 and #2424.
Test plan
Made with Cursor