Skip to content

[BUG] Task lifecycle: unable to create/delegate subtasks (multi level) after interruption #1100

Description

@aniruddhabag3

Problem (one or two sentences)

unable to create/delegate subtasks (multi level) after interruption

Context (who is affected and when)

Everyone and anytime.

Reproduction steps

  1. Start a task and have it create a subtask via new_task (level 1).
  2. From within that subtask, create another nested subtask (level 2) —
    confirm multi-level delegation works normally at this point.
  3. While a subtask is active/delegated, interrupt the session
    (e.g. reload VS Code window, restart the extension, or cancel mid-run).
  4. Resume the task/session.
  5. Ask the (resumed) parent task to create a new subtask via new_task again.
  6. Observe: the tool call fires with correct task details/parameters,
    but no actual subtask/delegation happens — instead the UI gets stuck
    showing a "Continue" button.
  7. Click "Continue" — it does not proceed, loops back to the same stuck state.
  8. Try creating/delegating a subtask again — same stuck "Continue" behavior repeats.

Expected result

After resuming an interrupted task, calling new_task should delegate normally and spawn/execute the new subtask, exactly as it does on a fresh (non-interrupted) session — including multi-level nesting.

Actual result

Actual Behavior: After interrupting and resuming a task that had an active/delegated subtask, the parent task appears to retain stale "delegated" status metadata pointing at a subtask that no longer exists. Any subsequent new_task call is correctly invoked with the right parameters, but delegation silently no-ops and the UI instead shows a "Continue" button. Clicking Continue does not resolve it and re-enters the same stuck state on every following delegation attempt — effectively an infinite loop that permanently blocks further subtask creation for that task until the whole session/task is abandoned and restarted from scratch. Suspected root cause: The "single-open subtask" guard that prevents a parent from spawning two children at once checks a persisted status flag (something like status: "delegated" / awaitingChildId) rather than verifying the referenced child task is actually still alive. When a task is interrupted mid-delegation, the child is torn down but the parent's persisted metadata is never reset back to "active" / cleared. On resume, the parent reloads that stale metadata, the guard thinks a child is still running, and blocks/loops instead of delegating.

Variations tried (optional)

No response

App Version

v3.74.0 (Release)

API Provider (optional)

None

Model Used (optional)

No response

Zoo Code Task Links (optional)

Video of the problem: Link

Relevant logs or errors (optional)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions