You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
OpenCode 2: a queue-delivered prompt detaches a foreground wait:true call the moment it is enqueued #563
On OpenCode 2, a prompt delivered with delivery: "queue" detaches a foreground wait: true shell call (and a sync bash_watch) the moment it is enqueued, exactly like delivery: "steer". A queued message is not shown to the agent until the current turn ends. So the detach hands control back for a message the agent cannot read yet, and the wait the caller asked for is lost.
Repro (aft-opencode 0.60.0 on OpenCode 2.0.31)
shell({command: "sleep 60", wait: true}). Then, from a plugin, ctx.session.prompt({sessionID, delivery, text}) with text containing no &detach:
delivery
prompt hook → tool completion
result
queue
4 ms
Detached because a user message arrived., metadata status: "running"
packages/opencode-plugin/src/v2-prompt-detach.ts: the prompt hook (interruptBashWaitsForV2Prompt, line 110) interrupts every waiting call for the session through interruptBashWaitsForChatMessage. V2PromptHookEvent (line 33) reads only sessionID, prompt and metadata, so the delivery mode never reaches the decision.
Expected
A queue delivery does not detach a foreground wait, since the agent cannot act on it until the turn ends. A steer delivery, or typed operator text, still detaches. If the hook event does not expose the mode, the hook could defer the detach until the message is actually admitted to the conversation.
The current workaround, bash.detach_on_user_message: false, also stops steer deliveries and operator messages from detaching, which is the case the detach exists for (#366).
Fixed in v0.61.0. On OpenCode 2, a queued message no longer detaches a running wait: true command or bash_watch. Steer messages and &detach still detach it. Thanks for the report, @iceteaSA.
Activity
mason: keep OpenCode 2 queued prompts from detaching waits
aft-alfonso commentedon Oct 20, 2026
Fixed in v0.61.0. On OpenCode 2, a queued message no longer detaches a running
wait: truecommand orbash_watch. Steer messages and&detachstill detach it. Thanks for the report, @iceteaSA.