Repository navigation
fix(macos): keep Gateway profile Keychain reads noninteractive - #128820
hannesrudolph wants to merge 2 commits into
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. Reviewed October 3, 2026, 10:49 AM ET / 14:49 UTC (Revision 10). ClawSweeper reviewWhat this changesThe PR suppresses automatic macOS Gateway-profile Keychain dialogs and preserves hidden profiles and pending legacy credentials when an explicit edit later obtains access. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readiness⛔ Blocked before merge - 4 items remain Keep open: the native proof supports the useful fix, but the previously reported process-wide Keychain coordination defect remains. Current main only partially addresses the problem, and the proposed replacement still acknowledges the same unfinished repair. Maintainer authorship and the protected label also prevent cleanup closure. Priority: P2 Review scores
Verification
How this fits togetherThe macOS app stores saved Gateway endpoints and credentials in Keychain, then uses them to populate connection pickers and establish Gateway connections. Background reads and explicit profile edits share the process with other Keychain consumers. flowchart TD
A[Background profile refresh] --> C[Gateway profile store]
B[Explicit profile edit] --> C
C --> D[Keychain interaction policy]
D --> E[macOS Keychain]
F[Gateway binding key store] --> E
E --> G[Saved profiles and connection credentials]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceOther +274. Total +274 across 2 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Extend the existing Keychain owner with shared process-wide coordination, preserve denial/retry semantics and authoritative mutation recovery, and remove the profile-only coordination path. Do we have a high-confidence way to reproduce the issue? Yes, source establishes the introduced overlap: pause a profile operation after disabling process interaction, then request an ACL-protected activation-binding key from another actor. This review did not execute that scenario; the supplied native evidence separately demonstrates the original profile prompt. Is this the best way to solve the issue? No, the fix is too narrow at the process boundary. Query-only suppression was disproved by the native evidence, but a profile-only lock cannot safely own Apple's shared interaction state. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against db01f6d520b8. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (9 earlier review cycles; latest 8 shown)
|
|
Exact-head macOS ACL proof completed on the live Setup: a valid
The follow-up wraps both noninteractive reads and the full update/add save transaction in a serialized capture/disable/restore boundary. Interactive mutations bypass it. The 17 focused tests remain green, including unavailable-read → authorized remove and blank same-route upsert cases that preserve hidden profiles, the migration receipt, and migrated credentials. Remaining proof boundary: mutation preservation is exercised with injected Keychain operations rather than UI automation; the real legacy-ACL no-prompt contract is now proven on the exact PR head. |
|
Final merge-ref native validation completed against GitHub synthetic merge commit
This supplements the exact-head restrictive-ACL signed-app proof already attached. No branch history rewrite was required. |



What Problem This Solves
Automatic macOS Gateway-profile reads and legacy migration can open login-Keychain authentication UI when a development signature does not own the saved item. Treating an unavailable Keychain like an empty registry can also make a later explicit mutation overwrite hidden profiles or discard a pending legacy-profile migration and its credentials.
Why This Change Was Made
Automatic reads and migration use a noninteractive
LAContextand distinguish missing, temporarily unavailable, and failed Keychain states. A real legacy login-Keychain ACL proved that modern no-UI controls still summon SecurityAgent, so noninteractive reads and saves also use the legacy process interaction switch inside a serialized capture/disable/restore boundary. Explicit add/remove operations remain interaction-allowed, reload authoritative Keychain data, reapply the existing idempotent legacy migration, and commit the migration plus mutation in one registry save.User Impact
Background refresh and local onboarding no longer trigger surprise Keychain dialogs or fail because the login Keychain is unavailable. Explicit profile changes may still request authorization, and they preserve hidden profiles, migrated credentials, and the migration receipt. There is no persisted schema change.
Evidence
mainbecause the noninteractive Keychain contract did not exist.profileNotFoundand lost credentials; after the repair all 17MacGatewayProfilesTestspass.git diff --checkpasses.5c39e305c257with a legacy item restricted to/usr/bin/security, then verified61dba15e6b82launches without a prompt against the same item.kSecUseAuthenticationUIFailstill prompts for the legacy item, whileSecKeychainSetUserInteractionAllowed(false)returns without UI and restores the previous process state.Proof gap: real legacy-ACL prompt suppression is exact-head tested; authorized mutation preservation is covered at the Keychain boundary with hidden-profile and migrated-credential regressions rather than UI automation.