Home

mweinbach / agent-coworker

publicmweinbach/agent-coworker
Overview Code History Branches Pull requestsIssuesInsights
main
HomeOverview Code PRsIssues

fix(session): fail-safe timeout for abandoned approval/ask prompts

4 months ago

3949a15
Authored
mweinbach6/9/2026, 6:16:31 PM
A pending approval or ask blocked the turn indefinitely if no client ever
answered (e.g. a headless client died, or the turn was orphaned). Transient
disconnects are already handled by replaying pending prompts on reconnect, so
the gap was only the truly-abandoned case.

Add a generous (30 min default, configurable, 0 disables) fail-safe backstop in
InteractionManager: an unanswered approval denies (returns false, never silently
runs) and an unanswered ask rejects, so the turn unblocks and the session stops
holding "busy" forever. Timers are unref'd and cleared on resolution.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

Parent827cd21

2 files changed
  • src/server/session/InteractionManager.ts+43−0
  • test/server/interactionManager.approval.test.ts+52−0