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
Thread tools: safe defaults for three known traps (queue send, settling a role thread, reply then tool calls) #1222
area:agentsOrchestration, slots, delegate, handoff, wake-ups, model policy, review rulessize:mediumContained, several files or teststype:featureNew behaviour or capability
What: three thread-tool traps that every new orchestrator session must be told about in writing today. Give each one a safe default instead:
t3_thread_send with mode "queue" to a running child either delivers at the end of the child's turn or says plainly that it will not. Today the written rule is "always steer, never queue".
A reply the user must read is not reduced to a one-line summary when tool calls follow it in the same turn. Today the written rule is "make every tool call before the answer, none after".
Evidence: three standing written rules, each added after the trap was hit.
Done when: each default has a test, and the written rules can be deleted.
Claim: a writer from the minors sweep is taking item 2 (t3_thread_organize refuses to settle the caller's own thread while it holds a role), branch fork/1222-role-settle-refusal. It needs two new seam lines in apps/server/src/mcp/toolkits/thread/handlers.ts, so a list-only announce PR comes first. Items 1 (queue send to a running child) and 3 (a reply followed by tool calls) are not in this round.
Item 1 (queue send to a running child): I traced it on main 40cd618 with an in-process test built on apps/server/src/mcp/TaskCancelUsageLimit.integration.test.ts. The parent delegates a task, the child's turn is running, and the parent calls t3_thread_send with mode: "queue". The send answers delivery: "queued". Then the child's turn ends:
child turn ends as
the queued follow-up
the task
completed
starts at once
running
interrupted
starts at once
running
failed (provider_error)
stays queued, queueHeld: true, never runs
failed
So the trap is the failed case. When a turn fails, Orchestrator.ts holds every queued run (the providerFailed branch near the queueHeld: true writes). The task goes failed and the parent's completion wake (delegatedCompletionWakeDetail) does not mention the follow-up, so the parent thinks it was sent. A person can still run it by resuming the child thread, outside any task.
Owner question (item 1 only), before anyone builds it:
(Recommended) Cancel the parent's held follow-ups when the task fails, and say so in the wake. The wake for a failed task adds a line such as "Your queued message to this task did not run and was cancelled: …". This matches task_cancel, which already cancels the follow-ups the parent queued in the child. The parent resends, which starts a fresh task. Nothing is left behind for a later Resume to run twice.
Keep them held (as now) and say so in the wake. The line tells the parent that the message is held in the child thread and to cancel it with t3_queue before resending. If the parent skips that step and someone resumes the child, it runs twice.
Either way, the change goes in Orchestrator.ts, an upstream file on fork-checks' UPSTREAM_FILES. So it needs a list-only seam announce PR first, and the owner has to merge it. I am not claiming item 1, and items 2 and 3 are untouched by this comment. Item 3 (a reply followed by tool calls) is in upstream web timeline code and needs a rule for which text counts as "the reply"; it is not small either.
Orchestrator decision: option 1. When the task fails, cancel the parent's held follow-ups the same way task_cancel does, and say so in the end-of-task message. Next step: the seam announce PR for the upstream file, then the fix.
area:agentsOrchestration, slots, delegate, handoff, wake-ups, model policy, review rulessize:mediumContained, several files or teststype:featureNew behaviour or capability
Activity
scuttletoby commentedon Nov 29, 2026
Claim: a writer from the minors sweep is taking item 2 (
t3_thread_organizerefuses to settle the caller's own thread while it holds a role), branchfork/1222-role-settle-refusal. It needs two new seam lines inapps/server/src/mcp/toolkits/thread/handlers.ts, so a list-only announce PR comes first. Items 1 (queue send to a running child) and 3 (a reply followed by tool calls) are not in this round.🤖 Generated with Claude Code
Role threads: check every orchestrator pointer that names the settled…
fork seams: announce the role-thread settle check's lines in thread/h…
scuttletoby commentedon Nov 30, 2026
Item 1 (queue send to a running child): I traced it on main 40cd618 with an in-process test built on
apps/server/src/mcp/TaskCancelUsageLimit.integration.test.ts. The parent delegates a task, the child's turn is running, and the parent callst3_thread_sendwithmode: "queue". The send answersdelivery: "queued". Then the child's turn ends:runningrunningprovider_error)queued,queueHeld: true, never runsfailedSo the trap is the failed case. When a turn fails,
Orchestrator.tsholds every queued run (theproviderFailedbranch near thequeueHeld: truewrites). The task goesfailedand the parent's completion wake (delegatedCompletionWakeDetail) does not mention the follow-up, so the parent thinks it was sent. A person can still run it by resuming the child thread, outside any task.Owner question (item 1 only), before anyone builds it:
failedtask adds a line such as "Your queued message to this task did not run and was cancelled: …". This matchestask_cancel, which already cancels the follow-ups the parent queued in the child. The parent resends, which starts a fresh task. Nothing is left behind for a later Resume to run twice.t3_queuebefore resending. If the parent skips that step and someone resumes the child, it runs twice.Either way, the change goes in
Orchestrator.ts, an upstream file on fork-checks'UPSTREAM_FILES. So it needs a list-only seam announce PR first, and the owner has to merge it. I am not claiming item 1, and items 2 and 3 are untouched by this comment. Item 3 (a reply followed by tool calls) is in upstream web timeline code and needs a rule for which text counts as "the reply"; it is not small either.🤖 Generated with Claude Code
scuttletoby commentedon Nov 30, 2026
Orchestrator decision: option 1. When the task fails, cancel the parent's held follow-ups the same way task_cancel does, and say so in the end-of-task message. Next step: the seam announce PR for the upstream file, then the fix.