Repository navigation
Replies: 1 comment
|
Related proposal: #26689 proposes an explicit, bounded wait for threads that end their turn while waiting on other work. It deliberately leaves blocking |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Problem
When an agent calls
t3_thread_wait(ordelegate_taskwithmode: "wait"), the call is a blocking tool call. The MCP handler waits until the other thread's run is terminal or the timeout hits (default 10 minutes, max 1 hour), and the agent cannot continue until the result comes back.So the waiting thread's run stays
runningfor the whole wait. The composer treats it like any active turn and offers only queue or steer. On Claude, a steer cancels the pending tool before the message lands, so the default send can cut the wait short and the agent sees a refusal-looking tool result. Queue avoids that, but the message sits behind a turn that is only waiting.Work that is already a background job behaves differently. With an async
delegate_task, a running subagent, a monitor or a watched PR, the turn ends. The thread looks idle, the composer sends a normal new turn, and a completion wake resumes the agent later.What exists today
delegate_taskalready returns ataskIdand wakes the parent on completion.t3_thread_waititself holds the turn.Request
Let a wait become a background job instead of a blocking call, so the waiting thread's turn can settle and the composer is idle.
Sketch:
t3_thread_wait(anddelegate_taskwithmode: "wait") can return immediately with a handle, and the thread is woken when the target run reaches a terminal state. The wake behaves like an asyncdelegate_taskcompletion.Open questions
timedOut=true) and with agents that do not support wake notifications?Related
Note
Written with Claude Code (model:
claude-sonnet-5-5) on behalf of the user.All reactions