Repository navigation
Silence the share-card failure beep in the test suite - #88
Merged
mstallone merged 28 commits intoAug 4, 2026
Merged
Conversation
testCopyToPasteboardReturnsFalseForUnencodableImage exercises the share-card failure path, whose NSSound.beep() played the system alert sound on every swift test run. The cue is now injectable: production keeps the beep, the test suite swaps in a counter — which also lets the failure test assert the cue fires exactly once.
…ut, probe ordering
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
mstallone
added a commit
that referenced
this pull request
Aug 4, 2026
…security (#89) > Stacked on #88, the tail of the credential stack. Closes the "High" finding from the latest post-stack review: Codex and Cursor could still recreate the automatic password-prompt loop. **TL;DR**: The last automatic prompt-capable `/usr/bin/security` reads — Codex's keyring lookups (detection, refresh fallback, unattended identity warming) and Cursor's two per-load reads — now run in-process through the coordinator, prompt-free on every automatic path. ## What was happening - `CodexAuthStore.loadKeychainAuth` and `CursorAuthStore`'s keychain reads used the `/usr/bin/security` subprocess: prompt-capable, ACL'd to the helper binary, uncoordinated, and running on launch detection, every automatic refresh, and Codex's background identity-warm task. - A protected item silently collapsed into "not logged in", so keychain-only logins were undetectable and unapprovable. ## What this changes - Codex `loadKeychainCredentials` / Cursor `loadCredentials` (tri-state like Copilot's): automatic paths use the prompt-free in-process reads; only a manual refresh may raise the approval prompt — once, authorizing Runway itself. - A protected item reports **permission-required**: it counts as a credential footprint for seeding, and the card says "…login found in Keychain. Refresh manually and choose Always Allow to connect it." - Cross-login guard mirrors the Copilot fix: a protected exact item (per-home Codex account item) never broadens to the service-only lookup, which could silently select a different login. Other Codex homes are still tried — each read targets its own exact account. - The unattended identity-warm task keeps its collapse-to-nil behavior (a protected home stays hidden with the existing log line) and is prompt-free by construction. - Docs: prompt behavior notes in `docs/providers/codex.md` / `cursor.md`; `docs/architecture.md` now states every provider's automatic Keychain reads are in-process and prompt-free. ## Also in this stack push (fixes from the same review, committed to their PRs) - **#85**: public existence/fingerprint probes now share the coordinator's per-item flight — a probe of an item whose read is wedged returns "unknown" within the bounded wait instead of stacking another `SecItemCopyMatching` onto securityd. - **#86**: the legacy device-id migration is gated on a prompt-free existence probe, so a fresh install never spawns the `/usr/bin/security` subprocess at all. ## Heads-up - Same one-time migration friction as #87: an "Always Allow" previously granted to `/usr/bin/security` doesn't carry over; the card shows the permission-required message until one manual refresh re-approves for Runway. The grant then sticks to the app permanently. - After this PR the only `/usr/bin/security` invocations left are Codex/Cursor **token-rotation writes** and the one-shot legacy device-id migration (now existence-gated). The write side is the remaining ownership audit — it decides whether Codex/Cursor become read-only like Claude, which changes rotation behavior and deserves its own design pass. ## Tests - Codex + Cursor read-mode regression tests (shared `ReadModeTrackingKeychain`): automatic loads perform only prompt-free reads, manual loads only interactive ones, never the subprocess-style path; protected items report permission-required and never broaden; a coordinator test proves probes don't stack behind a wedged read; an iCloud test proves fresh installs never spawn the legacy read. - `swift test`: 1,698 tests, 0 failures. --- ## Review follow-ups (later commits on this branch) - **Reset-credit claims can request approval.** `CodexResetClaimService` loaded keyring credentials non-interactively and collapsed permission-required to `nil`, so clicking **Use** reported a generic "Couldn't reset usage" while the credential that could serve it sat unread. Claiming is an explicit user action, so it may prompt exactly like a manual refresh. - **A denied Codex prompt stops the scan** on this branch too (it was previously only fixed downstream), so this PR is correct standing alone: an interactive denial returns `permissionRequired` immediately instead of opening one dialog per remaining Codex home.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TL;DR:
swift testno longer plays the system alert sound (Tink, or whatever the Mac's alert sound is) — the share-card failure beep is now injectable, and the test suite swaps it for a counter.What was happening
ShareCardRenderer's failure paths callNSSound.beep()so a failed clipboard export is never silent.testCopyToPasteboardReturnsFalseForUnencodableImagedeliberately exercises that path, so every automated test run played the system alert sound (/System/Library/Sounds/Tink.aiffon this machine).What this changes
ShareCardRenderer.playAlertSound, defaulting toNSSound.beep()— production behavior unchanged.ShareCardRendererTestsswaps it for a counter insetUp(restored intearDown), so the suite runs silently — and the failure test now also asserts the cue fires exactly once, which the old direct call couldn't verify.Tests
swift test: 1,689 tests, 0 failures — and no beep.