Repository navigation
[BUG] new_task delegation permanently broken after child sub-task context exhaustion return #887
Description
Describe the bug
When the user manually interrupts a delegated sub-task (via new_task) whose context window is near capacity, and returns to the parent Orchestrator session, all subsequent new_task delegations from that Orchestrator session permanently fail with "Task was interrupted before this tool call could be completed."
To Reproduce
Steps to reproduce the behavior:
1.Start an Orchestrator mode session
2.Successfully delegate several new_task calls to sub-modes — these work normally
3.Delegate a new_task to Debug mode (configured with a high-capacity model like GPT-5.6 Sol High)
4.Debug mode performs extensive investigation, rapidly filling its context window
5.While Debug's context is near capacity, the user manually interrupts the task and switches back to the parent Orchestrator session (to split the work into smaller tasks)
6.From the same Orchestrator session, attempt another new_task delegation to ANY mode
7.The new task immediately returns "Task was interrupted before this tool call could be completed." without the child task ever starting
8.All subsequent new_task calls in that Orchestrator session also fail permanently
Expected behavior
When the user manually stops a child sub-task and returns to the parent Orchestrator, the Orchestrator should be able to delegate new tasks. Each new_task call should create a fresh sub-task context independent of the interrupted session.
Screenshots
N/A
Video
N/A
What version of zoo are you running
3.69.100241
Additional context
Reproduction sequence (exact events from our session):
-Orchestrator (model: mimo-v2.5-pro) successfully delegated ~15 tasks across Code, Debug, Architect, Ask, Project Research, Code-Light modes over ~2-3 hours — all worked correctly.
-Orchestrator delegated a Debug verification task (Debug 1/6). Debug mode was configured with GPT-5.6 Sol High model. Debug performed extensive file reading and analysis, rapidly filling its context window.
The user manually interrupted the Debug task (while context was near full) and switched back to the parent Orchestrator session, intending to split the remaining work into smaller tasks.
-Orchestrator immediately attempted to delegate Debug 2/6 (smaller scope) → "Task was interrupted before this tool call could be completed."
-Orchestrator attempted a trivial Code mode test task (read 5 lines of a file) → same interruption.
-All subsequent new_task calls failed regardless of target mode.
Key observations:
-The failure is NOT mode-specific. After the trigger event, delegating to both Debug and Code failed.
-The Orchestrator's own context is still healthy: read_file, execute_command, write_to_file, attempt_completion all work normally.
-The new_task tool call returns a result (not a tool error), but the child task never executes.
-The trigger is specifically a user-initiated manual interruption of a child task with near-full context, not natural context exhaustion or the number of delegations.
-The child task was using GPT-5.6 Sol High (high-capacity model) which performed extensive investigation, causing rapid context growth.
-Workaround: Start a completely new Orchestrator session. Delegation works normally again.
-Suspected root cause: When the user manually interrupts a child sub-task with near-full context and returns to the parent Orchestrator, the delegation state (session reference, lock, or reopenParentFromDelegation internal state) in the parent session may not be properly cleaned up, causing all subsequent new_task calls to immediately fail.
Activity
edelauna commentedon Jul 26, 2026
Root-caused and fixed — closing.
Root cause. Your build (3.69.x) included #560 (shipped in v3.68.0), which changed interruption semantics so an interrupted delegated child keeps the parent in
status: "delegated"withawaitingChildIdintact. That is correct for resume/abandon, but the re-delegation path indelegateParentAndOpenChilddid not handle it: its updater unconditionally asserted a→ "delegated"transition, and the task-status state machine has nodelegated → delegatedself-transition. So the firstnew_taskafter interrupt-and-return threwInvalid task status transition: delegated → delegated, and the rollback path (pop child → delete child → recreate parent from disk) ranresumeTaskFromHistory, which backfills the orphanednew_tasktool_use block with"Task was interrupted before this tool call could be completed."— the message you saw. It is resume-backfill text, not a tool error; the real error was only logged. Nothing ever transitioned the parent out ofdelegated, which is why every subsequent delegation failed identically and only a new session recovered.Notes on your observations. "Context near full" was circumstantial — it is what motivated the interrupt; any manual interrupt of a delegated child followed by return-to-parent and re-delegate reproduced this. The child never executing, other tools working normally, and the new-session workaround all fall out of the same path.
Fix. #935 (abandon interrupted subtask, shipped in v3.72.0) added the missing branch: when the parent is
delegatedand the awaited child isinterrupted, the stale link is implicitly severed (delegated → active) before re-delegating. Please verify on ≥ v3.72 and reopen if you can still reproduce there.A residual fail-closed variant of this stuck state remains on
main(reachable only on an inner persistence failure during cancel); tracked separately so it does not block this close.