Description
If you detach the TUI while a permission prompt or interactive question is pending — or one is raised while you're detached — re-attaching leaves the session stuck. The agent is still blocked server-side waiting for a reply, but no prompt is shown and the input looks idle, so there's no way to answer. The only escape is forking the session, which discards the in-flight run.
The cause is that pending permission/question state is transient server memory (a Deferred the tool awaits), announced with a single permission.asked/question.asked event at ask time. The event stream doesn't replay pending state to a client that connects afterwards, and the TUI's bootstrap() hydrates everything on connect except these two stores — so a client that missed the live event never learns about the prompt.
Steps to reproduce
- Start a run that will trigger a permission prompt (e.g. an
edit/bash on ask), or one that uses the question tool.
- Detach the TUI before answering (or detach, then let a subagent raise a prompt).
- Re-attach to the session.
- The session sits idle with no prompt; the agent is blocked and only forking recovers it.
Operating System
macOS
Description
If you detach the TUI while a permission prompt or interactive
questionis pending — or one is raised while you're detached — re-attaching leaves the session stuck. The agent is still blocked server-side waiting for a reply, but no prompt is shown and the input looks idle, so there's no way to answer. The only escape is forking the session, which discards the in-flight run.The cause is that pending permission/question state is transient server memory (a
Deferredthe tool awaits), announced with a singlepermission.asked/question.askedevent at ask time. The event stream doesn't replay pending state to a client that connects afterwards, and the TUI'sbootstrap()hydrates everything on connect except these two stores — so a client that missed the live event never learns about the prompt.Steps to reproduce
edit/bashon ask), or one that uses thequestiontool.Operating System
macOS