Skip to content

Clear stale approval prompts after 5-minute timeout#27

Open
Swissola wants to merge 3 commits into
anthropics:mainfrom
Swissola:fix/approval-timeout
Open

Clear stale approval prompts after 5-minute timeout#27
Swissola wants to merge 3 commits into
anthropics:mainfrom
Swissola:fix/approval-timeout

Conversation

@Swissola
Copy link
Copy Markdown

Summary

  • Add a 5-minute timeout to stale approval prompts in the main loop
  • If a prompt has been pending without a response for longer than PROMPT_TIMEOUT_MS, clear promptId so the UI returns to normal

Motivation

If the desktop crashes or goes offline after sending a permission request, promptId is never cleared by the bridge. The approval UI stays visible indefinitely with no way to dismiss it short of a factory reset. The only escape was power cycling and hoping the bridge came back up quickly enough to send a fresh state.

5 minutes gives enough headroom to step away from the desk and come back without losing a legitimate prompt, while still recovering automatically from a hung or crashed bridge.

Behaviour after this change

  • Approval prompt dismissed automatically after 5 minutes of no response
  • Normal prompts (responded to in time) are unaffected
  • If the bridge reconnects within the timeout window and re-sends the prompt, it reappears normally

Test plan

  • Normal approve/deny flow unaffected
  • Disconnect the bridge while a prompt is pending — UI returns to normal after timeout
  • Reconnecting bridge within timeout window re-shows the prompt correctly

🤖 Generated with Claude Code

Swissola and others added 3 commits May 22, 2026 17:37
sleep=Donald Duck, idle=Bongo Cat, busy=SpongeBob multitasking,
attention=Surprised Pikachu (Nouns glasses), celebrate=Peanuts party,
dizzy=Powerpuff Girls spiral eyes, heart=heart eyes ghost.

Source GIFs in characters/memes-src/, device-ready pack in characters/memes/.
Built with prep_character.py at 96x98px, 64 colours per frame.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Track the current peer BD address in onConnect (extended overload).
bleRemoveCurrentBond() removes only that peer's LTK from NVS. The
"unpair" JSON command now calls this instead of bleClearBonds(), so
each host unpairs itself independently. bleClearBonds() is reserved
for factory reset only.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
If the desktop crashes or goes offline after sending a permission request
the promptId is never cleared by the bridge, leaving the approval UI
visible forever with no way to dismiss it short of factory reset.

Add a 5-minute timeout: if a prompt has been pending without a response
for longer than PROMPT_TIMEOUT_MS, clear promptId so the UI returns to
normal. 5 minutes is long enough to step away from the desk and come
back without losing a legitimate prompt.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

1 participant