fix: restore orchestrator subtask connection after VSCode restart #8622
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
Enhanced parent task detection in
attemptCompletionTool
: Now checks bothparentTask
(direct reference) andparentTaskId
(persisted ID) to handle cases where the direct reference is lost.Improved
finishSubTask
method inClineProvider
:Changes
src/core/tools/attemptCompletionTool.ts
: Check both parentTask and parentTaskIdsrc/core/webview/ClineProvider.ts
: Add parent task restoration logic in finishSubTaskTesting
Fixes #8621
Important
Fixes subtask-parent connection loss after VSCode restart by enhancing task detection and restoration in
attemptCompletionTool.ts
andClineProvider.ts
.attemptCompletionTool
inattemptCompletionTool.ts
now checks bothparentTask
andparentTaskId
to handle lost references.finishSubTask
inClineProvider.ts
storesparentTaskId
and attempts to restore parent task from history if not in stack.finishSubTask
.This description was created by
for fef9bb1. You can customize this summary. It will automatically update as commits are pushed.