Skip to content

Windows: take the approval card down when the relay stops waiting (#857) - #890

Open
afpruivo wants to merge 1 commit into
Louis-CFM:mainfrom
afpruivo:fix/windows-approval-card-expires
Open

afpruivo wants to merge 1 commit into
Louis-CFM:mainfrom
afpruivo:fix/windows-approval-card-expires

Conversation

@afpruivo

Copy link
Copy Markdown
Contributor

Fixes #857.

When the island's ack misses the 800 ms window (a busy or throttled webview), or nobody answers within 108 s, pipe.rs drops the request and Claude Code asks in the terminal. The island wasn't told, so it kept the card until its own 110 s timer. During that time clicking did nothing ("no pending request"), and every other permission request was handed back to the terminal by the one-card rule.

Change

  • pipe.rs: when wait_for_decision returns no decision, emit approval-expired with the request id.
  • island/hooks.ts: on approval-expired, if the card on screen belongs to that request, drop it and cancel its 110 s timer. Any other id is ignored.

Events reach the island in order, so a card that comes up after the ack window still goes. #849 and #869 touch the same files but not these lines.

Tests

  • New test in tests/hooks.test.mjs: another request's expiry leaves the card alone; its own expiry takes it down; the next request gets its card, and the old 110 s timer doesn't take it down.
  • Live on Windows 11, with the island's JavaScript frozen for 2.5 s over WebView2 remote debugging while request A came in, then request B 3 s later:
    • 0.5.2 (same pipe.rs and hooks.ts as main): A's ack misses the 800 ms window, A's card comes up anyway and stays; B is declined at once (decline id=…, not shown — terminal takes over).
    • This branch: A's card is gone once the island wakes; B gets its own card and the relay waits for it.
  • npm test (467 passed), cargo test --lib (516 passed), tsc --noEmit clean, on Windows 11.

🤖 Generated with Claude Code

…uis-CFM#857)

When the island's ack misses the 800 ms window (or nobody answers within
108 s), pipe.rs drops the request and the terminal takes over, but the
island kept the card for its own 110 s. Clicks did nothing, and every
other PermissionRequest in that time was declined by the one-card rule.

Rust now emits `approval-expired` with the request id when it gives up
without a decision; the island drops the card if it is that request's
and cancels its 110 s timer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows: approval card stays after the relay gave up and auto-declines other requests for ~110 s

1 participant