fix: comprehensive orchestrator mode restoration for sub-tasks (#5747) #5748
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.
This PR fixes the orchestrator mode restoration issue described in #5747 where sub-tasks launched by the Orchestrator mode were not properly returning to the parent Orchestrator task after completion or interruption.
Problem
Solution
This PR implements a comprehensive fix with four major components:
1. Enhanced mode restoration in resumePausedTask method
Task.tslines 766-7932. Mode restoration safety net in finishSubTask method
ClineProvider.tslines 229-264 to include mode restoration as a safety net3. Mode validation and restoration in task resumption from history
Task.tslines 814-8384. Error handling for interrupted sub-tasks
Task.tslines 1462-1520 to include mode restorationKey Changes
resumePausedTask(),resumeTaskFromHistory(), and stream error handling methods with comprehensive mode restoration logicfinishSubTask()methodTesting
Impact
Fixes #5747
Important
Fixes orchestrator mode restoration for sub-tasks, ensuring correct mode restoration on task resumption, completion, and interruption.
Task.tsandClineProvider.ts.resumePausedTask()andresumeTaskFromHistory()inTask.tsnow include mode restoration logic.finishSubTask()inClineProvider.tsadds a safety net for mode restoration.Task.tsto restore mode during sub-task interruptions.This description was created by
for 53e264b. You can customize this summary. It will automatically update as commits are pushed.