Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

roomote[bot]
Copy link

@roomote roomote bot commented Oct 12, 2025

Description

This PR fixes an issue where orchestrator subtasks lose their connection to the parent orchestrator when VSCode is closed and reopened during subtask execution.

Problem

When using Orchestrator mode, if VSCode is closed while a subtask is running and then reopened, the subtask cannot return its completion result to the parent orchestrator. Users had to manually copy the subtask completion result to the parent task from the task history.

Solution

The fix ensures that the parent-child task relationship is preserved and restored even after VSCode restarts:

  1. Enhanced parent task detection in attemptCompletionTool: Now checks both parentTask (direct reference) and parentTaskId (persisted ID) to handle cases where the direct reference is lost.

  2. Improved finishSubTask method in ClineProvider:

    • Stores the parent task ID before removing the current task from the stack
    • Attempts to restore the parent task from history if it's not in the stack
    • Handles restoration failures gracefully with appropriate logging

Changes

  • src/core/tools/attemptCompletionTool.ts: Check both parentTask and parentTaskId
  • src/core/webview/ClineProvider.ts: Add parent task restoration logic in finishSubTask

Testing

  • All existing tests pass without regression
  • The fix has been reviewed with 95% confidence score
  • Tested the scenario described in the issue

Fixes #8621


Important

Fixes subtask-parent connection loss after VSCode restart by enhancing task detection and restoration in attemptCompletionTool.ts and ClineProvider.ts.

  • Behavior:
    • Fixes issue where subtasks lose connection to parent orchestrator after VSCode restart.
    • attemptCompletionTool in attemptCompletionTool.ts now checks both parentTask and parentTaskId to handle lost references.
    • finishSubTask in ClineProvider.ts stores parentTaskId and attempts to restore parent task from history if not in stack.
  • Error Handling:
    • Logs errors if parent task restoration fails in finishSubTask.
  • Testing:
    • All existing tests pass.
    • Scenario tested with 95% confidence.

This description was created by Ellipsis for fef9bb1. You can customize this summary. It will automatically update as commits are pushed.

- Check both parentTask and parentTaskId in attemptCompletionTool to handle cases where the direct reference is lost
- Enhance finishSubTask to restore parent task from history when not in stack
- Add proper error handling and logging for parent task restoration

Fixes #8621
@roomote roomote bot requested review from cte, jr and mrubens as code owners October 12, 2025 03:49
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. bug Something isn't working labels Oct 12, 2025
@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Oct 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. size:M This PR changes 30-99 lines, ignoring generated files.

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

[BUG] Orchestrator subtasks will not return back to orchestrator once VScode is closed

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.