-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Subtasks are sometimes not reporting back to Parent tasks #1547
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
From some Roo Code investigation: Subtask Cancellation and Resumption Issue AnalysisAfter investigating the code, I've identified the issue with subtasks not reporting back to parent tasks when cancelled and resumed. Root CauseThe problem occurs in the
SolutionThe solution is to modify the async cancelTask() {
if (this.getCurrentCline()) {
const currentCline = this.getCurrentCline()!;
const { historyItem } = await this.getTaskWithId(currentCline.taskId);
// Check if this is a subtask before aborting
const isSubTask = currentCline.isSubTask;
currentCline.abortTask();
await pWaitFor(
() =>
currentCline === undefined ||
currentCline.isStreaming === false ||
currentCline.didFinishAbortingStream ||
currentCline.isWaitingForFirstChunk,
{
timeout: 3_000,
},
).catch(() => {
console.error("Failed to abort task");
});
if (currentCline) {
currentCline.abandoned = true;
}
// If this was a subtask, notify the parent task
if (isSubTask) {
await this.finishSubTask(`Task cancelled: The subtask was cancelled by the user.`);
}
// Reinitialize from history
await this.initClineWithHistoryItem(historyItem);
}
} This change would ensure that when a subtask is cancelled, the parent task is properly notified and can continue execution, resolving the issue where subtasks don't report back to parent tasks when cancelled and resumed. Implementation ChallengeThe main challenge is that the
The second approach is simpler and can be implemented without modifying the // If this was a subtask (has a parent task), notify the parent task
if (currentCline.getParentTask()) {
await this.finishSubTask(`Task cancelled: The subtask was cancelled by the user.`);
} This change would fix the issue with cancelled subtasks not reporting back to their parent tasks. |
Which version of the app are you using?
3.8.4
Which API Provider are you using?
Anthropic
Which Model are you using?
Claude 3.7 Sonnet
What happened?
Sometimes subtasks are not reporting back to parent tasks which breaks the workflow. It seems as if it is sometimes losing its subtask-state.
Steps to reproduce
I noticed this sometimes even happened without me cancelling and resuming the subtask.
Relevant API REQUEST output
Additional context
No response
The text was updated successfully, but these errors were encountered: