Skip to content

[BUG] Interrupted subtask leaves a success-looking attempt_completion in conversation history #1283

Description

@martin-rueegg

Problem (one or two sentences)
A delegated subtask that is interrupted while its "finish task" confirmation is showing ends up with a conversation history that falsely looks like it completed, while the task list still shows the subtask as "interrupted" and the parent stays stuck waiting for the child.

Context (who is affected and when)
Affects users who create a subtask, let it reach the "finish task?" confirmation, then switch away to the parent (or any other task) without confirming, and later reopen the subtask from history. In plain terms: the task list and the task's saved conversation no longer agree about whether the task finished.

Reproduction steps

  1. Environment: VS Code + Zoo Code extension (recent version), any API provider/model.
  2. Start a task that calls new_task and creates a child subtask. Let the child work until it presents the attempt_completion / "finish task?" confirmation.
  3. Do NOT confirm. Navigate away to the parent or to any other task (this evicts the child).
  4. Reopen the child from task history. Observe that it now shows a "Resume task" prompt instead of the completion confirmation.
  5. Resume and let it continue (or just leave it). Inspect the task's stored files under the extension's global storage (tasks/<task-id>/):
    • history_item.json"status": "interrupted"
    • api_conversation_history.json → ends with an attempt_completion tool_use followed by a tool_result whose content is "Task was interrupted before this tool call could be completed." and which has no is_error: true flag.

Expected result
The task list status and the conversation history agree. The interrupted tool call is recorded as an error (e.g. is_error: true), so nothing interprets it as a successful completion.

Actual result
The task list shows the child as "interrupted" and the parent as still waiting for the child, but the API conversation history ends with a successful-looking attempt_completion tool_result. Any tool/importer that infers completion from the history concludes the task completed.

Variations tried (optional)
N/A

App Version
Version: 3.76.0 (5b0bcd0) (in Jetbrains Phpstorm)

API Provider (optional)
Not Applicable / Other

Model Used (optional)
N/A

Zoo Code Task Links (optional)
(none)

Relevant logs or errors (optional)
DEBUG REPORT — ACH ↔ history-item status inconsistency: root cause (v3)

zoo-code extension activated - {"publisher":"ZooCodeOrganization","name":"zoo-code","version":"3.76.0","outputChannel":"Zoo-Code","releaseChannel":"stable"}
[Default Commands Migration] Migration already completed, skipping
Skipping migration of cline_custom_modes.json to custom_modes.json: old file not found
Skipping migration of cline_mcp_settings.json to mcp_settings.json: old file not found
No custom_modes.json found, skipping YAML migration
[auth] Using WebAuthService
[auth] changeState: initializing -> logged-out
[AutoImport] No auto-import settings path specified, skipping auto-import
[createTaskWithHistoryItem] parent task 019fb786-503a-76ca-8708-fee1243c878d.f8e85f5e instantiated
[createTaskWithHistoryItem] parent task 01a005cf-1d19-7787-990f-27e66e65f49d.0e4f4a28 instantiated
[createTaskWithHistoryItem] parent task 019fb786-503a-76ca-8708-fee1243c878d.dc650770 instantiated
[createTask] child task 01a00f11-14ac-716e-8d37-fdfd91163e1e.3921fef6 instantiated
[markDelegatedChildInterrupted] Marked child 01a00f11-14ac-716e-8d37-fdfd91163e1e interrupted; parent 019fb786-503a-76ca-8708-fee1243c878d stays delegated
[createTaskWithHistoryItem] parent task 019fb786-503a-76ca-8708-fee1243c878d.a0721bde instantiated
[createTaskWithHistoryItem] parent task 01a00f11-14ac-716e-8d37-fdfd91163e1e.d4b1442c instantiated
[createTaskWithHistoryItem] parent task 019fb786-503a-76ca-8708-fee1243c878d.ff34c587 instantiated
[createTask] child task 01a00fcd-36f2-71e4-b31a-eae8aa0a2e78.d245caf1 instantiated

and

zoo-code extension activated - {"publisher":"ZooCodeOrganization","name":"zoo-code","version":"3.76.0","outputChannel":"Zoo-Code","releaseChannel":"stable"}
[Default Commands Migration] Migration already completed, skipping
Skipping migration of cline_custom_modes.json to custom_modes.json: old file not found
Skipping migration of cline_mcp_settings.json to mcp_settings.json: old file not found
No custom_modes.json found, skipping YAML migration
[auth] Using WebAuthService
[auth] changeState: initializing -> logged-out
[AutoImport] No auto-import settings path specified, skipping auto-import
[createTaskWithHistoryItem] parent task 019f3d09-0e30-70cb-ad30-e9c153622f50.80c4727c instantiated
[createTaskWithHistoryItem] parent task 019f8b03-4bd1-7079-8ae0-573e7985cd58.f8c304b6 instantiated
[createTask] child task 01a01073-e5de-7750-8467-a6737032ceb4.6515dcd7 instantiated
[delegateParentAndOpenChild] Failed to persist parent metadata for 019f8b03-4bd1-7079-8ae0-573e7985cd58 -> 01a01073-e5de-7750-8467-a6737032ceb4: [delegateParentAndOpenChild] Cannot re-delegate: existing child 01a00ef8-903d-708f-97d1-72d80e0a8d88 is active, not interrupted
[createTaskWithHistoryItem] parent task 019f8b03-4bd1-7079-8ae0-573e7985cd58.c1951d50 instantiated
[createTaskWithHistoryItem] parent task 01a00ef8-903d-708f-97d1-72d80e0a8d88.ee0043ab instantiated
[markDelegatedChildInterrupted] Marked child 01a00ef8-903d-708f-97d1-72d80e0a8d88 interrupted; parent 019f8b03-4bd1-7079-8ae0-573e7985cd58 stays delegated
[createTaskWithHistoryItem] parent task 019f8b03-4bd1-7079-8ae0-573e7985cd58.bd959b87 instantiated

Root cause
resumeTaskFromHistory() synthesizes an interruption tool_result ("Task was interrupted before this tool call could be completed.") for the dangling attempt_completion tool_use without is_error: true (Task.ts:2095-2099), so the ACH falsely reports a successful completion. The interrupted HI status is correct; the ACH is the misleading artifact.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions