Skip to content

Conversation

@hannesrudolph
Copy link
Collaborator

@hannesrudolph hannesrudolph commented Nov 7, 2025

Closes: #8081

Summary

This update makes subtask hand‑offs smoother while keeping the UI exactly the same:

  • Subtasks now maintain their connection from child to parent even when VS Code has been restarted
  • Automatic parent resume: when a subtask finishes, the parent continues without a “resume task” prompt.
  • Single‑open safety: only one task is open at a time to avoid race conditions and state conflicts.

What you’ll notice

  • Fewer interruptions and faster hand‑offs between tasks.
  • No visual changes in this PR; all improvements are behavioral.

Important

Introduce metadata-driven subtasks with automatic parent resume and single-open safety, adding delegation events and updating task handling logic.

  • Behavior:
    • Introduces metadata-driven subtasks with automatic parent resume and single-open safety.
    • Adds delegation events: TaskDelegated, TaskDelegationCompleted, TaskDelegationResumed in ExtensionChannel.ts and api.ts.
    • Removes finishSubTask method in ClineProvider.ts and replaces it with metadata-driven delegation logic.
  • Tests:
    • Adds tests for delegation events in ExtensionChannel.test.ts and new test files like delegation-events.spec.ts.
    • Tests for single-open-task invariant in single-open-invariant.spec.ts.
  • Misc:
    • Updates Task class in Task.ts to support new delegation flow.
    • Minor changes in webviewMessageHandler.ts to handle task clearing with new logic.

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

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Nov 7, 2025
@hannesrudolph hannesrudolph moved this from Triage to PR [Draft / In Progress] in Roo Code Roadmap Nov 7, 2025
@hannesrudolph hannesrudolph added PR - Draft / In Progress and removed Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. labels Nov 7, 2025
@hannesrudolph hannesrudolph force-pushed the feat/metadata-delegation-subtasks-qa branch from f71b6bb to 53f3b2d Compare November 7, 2025 05:06
@hannesrudolph hannesrudolph force-pushed the feat/metadata-delegation-subtasks-qa branch from 6d0d066 to 9fa17c7 Compare November 7, 2025 17:05
@hannesrudolph hannesrudolph force-pushed the feat/metadata-delegation-subtasks-qa branch from b2a0e60 to d734788 Compare November 8, 2025 03:19
@hannesrudolph hannesrudolph force-pushed the feat/metadata-delegation-subtasks-qa branch from d734788 to 05e6a98 Compare November 13, 2025 00:13
@hannesrudolph hannesrudolph marked this pull request as ready for review November 13, 2025 00:14
@dosubot dosubot bot added size:XXL This PR changes 1000+ lines, ignoring generated files. documentation Improvements or additions to documentation enhancement New feature or request labels Nov 13, 2025
@roomote
Copy link
Contributor

roomote bot commented Nov 13, 2025

Rooviewer Clock   See task on Roo Cloud

All previously flagged issues have been resolved. No new issues found.

  • skipPrevResponseIdOnce property is declared and set but never consumed in the codebase, making it non-functional
Previous reviews

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

@hannesrudolph hannesrudolph changed the title Metadata-driven subtasks: delegation flow, auto-resume, nested returns, UI badges, tests, docs Metadata‑driven subtasks (no UI changes): automatic parent resume and single‑open safety Nov 13, 2025
Copy link
Contributor

@roomote roomote bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skipping the entire test suite defeats the purpose of having tests for critical abort noise prevention logic. If these tests are no longer relevant due to the refactor, they should be updated to reflect the new implementation rather than disabled. This leaves the checkpoint abort handling untested and could allow regressions in error handling during task disposal.

Fix it with Roo Code or mention @roomote and request a fix.

…nused import; type-safe ExtensionChannel event publishing
The Task.resumeAfterDelegation() method was added in the implementation but
the test mocks were not updated accordingly. This caused test failures with
'resumeAfterDelegation is not a function' errors.

Updated mock task instances in:
- src/__tests__/history-resume-delegation.spec.ts
- src/__tests__/attempt-completion-delegation.spec.ts

All mocks now include:
- resumeAfterDelegation: vi.fn().mockResolvedValue(undefined)
- overwriteClineMessages: vi.fn().mockResolvedValue(undefined) (where needed)
- overwriteApiConversationHistory: vi.fn().mockResolvedValue(undefined) (where needed)
- Reset all localization files (src/i18n and webview-ui/i18n) to main
- Remove isFocused prop usage from DelegationUI test
- Keep PR focused on backend metadata orchestration only
Keep only core feature tests:
- single-open-invariant.spec.ts (single-open safety)
- nested-delegation-resume.spec.ts (automatic parent resume)
- delegation-events.spec.ts (lifecycle events)
- history-resume-delegation.spec.ts (history resume)
- new-task-delegation.spec.ts (new_task tool)
- provider-delegation.spec.ts (provider delegation)

Remove edge case tests to keep PR focused on core functionality.
@hannesrudolph hannesrudolph force-pushed the feat/metadata-delegation-subtasks-qa branch from 1977ea5 to b47a930 Compare November 13, 2025 00:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request PR - Needs Preliminary Review size:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

Status: PR [Needs Prelim Review]

Development

Successfully merging this pull request may close these issues.

[BUG] Subtask completes but doesn’t return to parent after interruptions

2 participants