feat: enrich subtask handoff with structured context summaries (Phase 1 of #12330)#12332
Open
roomote-v0[bot] wants to merge 2 commits into
Open
feat: enrich subtask handoff with structured context summaries (Phase 1 of #12330)#12332roomote-v0[bot] wants to merge 2 commits into
roomote-v0[bot] wants to merge 2 commits into
Conversation
Phase 1 of #12330 - improves context handoff visibility between parent and child tasks during delegation. Changes: - Add SubtaskSummary type to @roo-code/types for structured handoff data - Create buildSubtaskSummary utility that extracts files modified/read, commands executed, tool usage, and todo stats from task history - Modify AttemptCompletionTool to build structured summary on completion - Update reopenParentFromDelegation to format enriched API history text so the parent LLM gets better context about what the subtask did - Update ChatRow UI to render structured summaries with mode badge, file lists, command lists, and todo progress - Add i18n translation keys for new UI elements - Add 19 tests for buildSubtaskSummary and formatSubtaskSummaryForApi - Backward compatible: plain-text summaries still work as before
2 tasks
|
Thanks for the quick work on this! I noticed the Overall the implementation looks clean and non-intrusive. Appreciate you getting the first version out so fast. |
Contributor
Author
Added the 4 missing subtask translation keys ( |
6 tasks
This was referenced May 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Related GitHub Issue
Closes: #12330 (Phase 1)
Description
This PR attempts to address Issue #12330 by implementing Phase 1: Enhanced context handoff visibility between parent and child tasks during delegation.
When a subtask completes via
attempt_completion, the handoff back to the parent now includes a structured summary of what the subtask accomplished, rather than just the raw completion text. This gives both the parent LLM and the user much better visibility into the subtask's work.Key implementation details:
SubtaskSummarytype (packages/types/src/history.ts): New structured type capturing mode, files modified/read, commands executed, tool usage counts, and todo completion stats.buildSubtaskSummaryutility (src/core/task/buildSubtaskSummary.ts): Scans the child task's API conversation history to extract tool_use blocks and build metadata. Also providesformatSubtaskSummaryForApifor enriched parent LLM context.AttemptCompletionTool: Builds the structured summary on subtask completion, with try/catch fallback to plain text for robustness.reopenParentFromDelegation: Parses the structured summary, uses enriched markdown format for the API history (so the parent LLM gets files changed, mode, commands, etc.) and passes raw JSON to the UI message.ChatRowUI: Detects JSON summaries and renders structured data with mode badge, file lists, command lists, and todo progress. Falls back to plain markdown for backward compatibility.Test Procedure
src/core/task/__tests__/buildSubtaskSummary.spec.tscovering:formatSubtaskSummaryForApioutput formattingnewTaskTool.spec.ts,history-resume-delegation.spec.ts,nested-delegation-resume.spec.ts,new-task-delegation.spec.ts)Pre-Submission Checklist
Documentation Updates
No user-facing documentation changes required. This enhancement is transparent to existing workflows.
Feedback and guidance are welcome.
Interactively review PR in Roo Code Cloud