Skip to content

Add Claude setting to suppress Keychain access explanation - #2718

Draft
MGidnian wants to merge 4 commits into
steipete:mainfrom
MGidnian:agent/claude-keychain-explanation-setting
Draft

Add Claude setting to suppress Keychain access explanation#2718
MGidnian wants to merge 4 commits into
steipete:mainfrom
MGidnian:agent/claude-keychain-explanation-setting

Conversation

@MGidnian

@MGidnian MGidnian commented Aug 6, 2026

Copy link
Copy Markdown

Summary

  • Add a Claude setting, Show Keychain access explanation, with an explicit opt-out.
  • Suppress CodexBar's explanatory pre-alert for Claude OAuth Keychain access when the setting is off.
  • Preserve the existing explanation-by-default behavior for installations that have not set the preference.
  • Add a separate result-capable prompt callback so the app can report whether an explanation was actually shown,
    without changing the public KeychainPromptHandler.handler callback signature.
  • Preserve explicit legacy handler overrides ahead of the default result-capable route.
  • Preserve the native macOS Keychain prompt and all OAuth/Keychain behavior.
  • Add persistence and prompt-gating tests and document the distinction between the two prompts.

Motivation

When refreshing Claude usage, CodexBar can show its explanatory alert before macOS asks for access to the Claude OAuth Keychain item. After the user has already granted access with “Always Allow”, seeing the explanatory alert again is cumbersome. The existing cooldown is temporary and does not provide a durable preference for an already-authorized setup.

This change makes the common already-authorized flow quiet after the user disables the explanation in Claude settings,
while preserving the current explanation-by-default behavior for upgrades. That avoids silently changing an existing
installation's security/education flow; new or existing users can opt out explicitly once they understand the prompt.

Scope and safety

This only suppresses CodexBar's explanatory alert for the .claudeOAuth prompt context. It does not disable Keychain
access, change ClaudeOAuthKeychainPromptMode, bypass native macOS authorization, or alter OAuth refresh behavior.
The native macOS authorization prompt remains controlled by macOS. The additive result callback keeps the existing
six-hour cooldown semantics correct: only a displayed CodexBar explanation acknowledges the cooldown, while existing
CodexBarCore clients can continue assigning the public Void callback.

Follow-up UX option

If maintainers prefer an inline acknowledgement, the same preference could later be exposed directly in this alert with an option such as “Don't show this again.” I kept this PR settings-first so the preference is explicit, discoverable, and consistent with the existing Claude authentication controls.

Verification

  • make check
  • make test (823 selections, 69 groups, all passed)
  • swift test --filter 'KeychainPromptCoordinatorTests|SettingsStoreCoverageTests|ClaudeOAuthKeychainPreAlertGateTests'
    (59 tests, all passed)
  • The focused tests cover the unset/default state, explicit opt-out state, persistence, and the false handler result
    used by suppression, plus precedence for legacy public handler overrides; the full suite covers the unchanged native
    Keychain integration paths.
  • The production app compilation path built successfully during validation. Complete packaging was attempted with
    ./Scripts/compile_and_run.sh, but the separate Widget extension xcodebuild stalled in the locked CI-like local
    environment; no Keychain credentials or native authorization prompts were touched.
  • UI screenshot capture was not possible because the Mac was locked during the runtime check. No live provider or
    Keychain reads were performed.

Screenshots

Not included: this reuses the existing provider settings UI and changes the visibility of the existing explanatory flow
rather than adding a new visual component. The focused and full test commands above are the available redacted terminal
evidence for both preference states.

Related

Related to #2588 and #2668.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal priority bug or improvement with limited blast radius. merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. labels Aug 6, 2026
@clawsweeper

clawsweeper Bot commented Aug 6, 2026

Copy link
Copy Markdown

Codex review: needs real behavior proof before merge. Reviewed August 12, 2026, 10:09 AM ET / 14:09 UTC.

ClawSweeper review

What this changes

Adds a persisted Claude setting to suppress CodexBar’s Keychain explanation while retaining native macOS authorization and OAuth behavior.

Merge readiness

Blocked until real behavior proof from a real setup is added - 5 items remain

The feature remains distinct from current main, but needs maintainer UX direction, a rebase, and real behavior proof before merge.

Priority: P2
Reviewed head: 05cfaea10156ae5405b3c1696ae69ef14d262be1
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The implementation is focused and tested, but merge conflicts and absent real behavior proof leave it unready to merge.
Proof confidence 🧂 unranked krab (1/6) Needs real behavior proof before merge: The PR provides tests and compilation claims but no redacted after-fix bundled-app or real Keychain interaction evidence. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: The PR provides tests and compilation claims but no redacted after-fix bundled-app or real Keychain interaction evidence. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 6 items Current main behavior: Main always installs the explanatory Keychain handler, and eligible Claude reads pass through the pre-alert gate; no explanation opt-out is present.
Cooldown contract: The pre-alert cooldown is recorded only when its presentation callback returns true, supporting the PR’s result-aware gating approach.
Existing related setting: Current settings offer “Avoid Keychain prompts,” which controls native prompt eligibility rather than only CodexBar’s explanatory alert.
Findings None None.
Security None None.

How this fits together

Claude usage refreshes can read OAuth credentials from macOS Keychain. CodexBar shows an explanatory alert before a possible native prompt, then reads credentials to fetch usage.

flowchart LR
A[Claude usage refresh] --> B[Keychain access preflight]
B --> C[CodexBar explanation gate]
C --> D[Native macOS Keychain prompt]
D --> E[Claude OAuth credential read]
E --> F[Usage result]
Loading

Decision needed

Question Recommendation
Should CodexBar add a separate persistent opt-out for its Claude Keychain explanation rather than retain only the broader native-prompt policy or use an inline acknowledgement? Sponsor the separate setting: Keep the default explanation and accept this narrow opt-out after rebase and runtime proof.

Why: This is a new security-education preference, not a repair to a defined broken contract; source proves it is distinct but cannot establish the desired UX policy.

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: The PR provides tests and compilation claims but no redacted after-fix bundled-app or real Keychain interaction evidence. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Resolve merge risk (P1) - GitHub reports the draft branch as dirty against current main, so its shared callback and Claude settings changes need rebase review.
  • Resolve merge risk (P1) - The opt-out intentionally changes security education in an OAuth/Keychain flow and needs proof that only CodexBar’s alert is suppressed.
  • Complete next step (P2) - Maintainer UX direction, a rebase, and contributor real-behavior proof are required before merge.
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Changed surface 18 files: 13 source, 3 test, 2 docs The preference reaches the shared Keychain callback boundary, Claude settings, tests, and documentation.

Merge-risk options

Maintainer options:

  1. Rebase and prove the scoped opt-out (recommended)
    Resolve the current-main conflict and provide redacted bundled-app evidence that only CodexBar’s explanation is suppressed while macOS authorization remains intact.
  2. Pause for UX direction
    Hold the PR if maintainers prefer an inline acknowledgement or the existing policy over a persistent setting.

Technical review

Best possible solution:

Keep the explanation enabled by default, add the scoped opt-out only if its UX is accepted, and merge a rebased branch with redacted bundled-app proof for both states.

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

Not applicable: this PR proposes a new opt-out preference, though current source clearly identifies the explanation path it would change.

Is this the best way to solve the issue?

Unclear: the design preserves defaults and native authorization, but maintainers must choose whether a separate setting is preferable to an inline acknowledgement or current policy.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: This is a bounded Claude-provider UX feature without evidence of an urgent credential or runtime failure.
  • merge-risk: 🚨 auth-provider: The PR changes the Claude OAuth Keychain prompt path, where incorrect gating can affect credential-access flows.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR provides tests and compilation claims but no redacted after-fix bundled-app or real Keychain interaction evidence. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: The available current-main blame and nearby Claude history place the Keychain explanation path in his recent work area. (role: recent area contributor; confidence: low; commits: 330ae4384b18, 9d38b08e5e07; files: Sources/CodexBarCore/Providers/Claude/ClaudeOAuth/ClaudeOAuthCredentials.swift, Sources/CodexBar/KeychainPromptCoordinator.swift, Sources/CodexBar/Providers/Claude/ClaudeProviderImplementation.swift)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Rebase onto current main and resolve the reported conflict.
  • Add redacted runtime proof covering enabled and disabled states while preserving native macOS authorization.
  • Update the PR body after proof; if needed, ask a maintainer to comment @clawsweeper re-review.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • 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.

History

Review history (18 earlier review cycles; latest 8 shown)
  • reviewed 2026-08-07T23:49:13.588Z sha 05cfaea :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-08T05:04:02.425Z sha 05cfaea :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-08T11:26:22.223Z sha 05cfaea :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-08T13:47:48.500Z sha 05cfaea :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-08T15:12:17.481Z sha 05cfaea :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-08T16:56:13.536Z sha 05cfaea :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-08T23:41:19.708Z sha 05cfaea :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-09T04:56:24.100Z sha 05cfaea :: needs real behavior proof before merge. :: none

MGidnian commented Aug 7, 2026

Copy link
Copy Markdown
Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 7, 2026

Copy link
Copy Markdown

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

MGidnian commented Aug 7, 2026

Copy link
Copy Markdown
Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 7, 2026

Copy link
Copy Markdown

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. merge-risk: 🚨 auth-provider 🚨 Merging this PR could break OAuth, tokens, provider routing, model choice, or credentials. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Aug 7, 2026

MGidnian commented Aug 7, 2026

Copy link
Copy Markdown
Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 7, 2026

Copy link
Copy Markdown

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Aug 7, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Aug 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 auth-provider 🚨 Merging this PR could break OAuth, tokens, provider routing, model choice, or credentials. P2 Normal priority bug or improvement with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant