feat: Phase 5 - Background Tasks Panel UI#12343
Conversation
…ner) Implements the MVP for Phase 4 of the parallel execution roadmap: - Add BackgroundTaskRunner service that manages concurrent read-only background tasks separately from the clineStack - Add isBackgroundTask flag to Task class that suppresses webview updates and auto-approves all tool uses - Extend new_task tool with optional background parameter - Background tasks are restricted to read-only tools only - Results are delivered asynchronously to the parent task via onBackgroundComplete callback - Configurable concurrency limit (default 3) and timeout (default 5min) - Proper cleanup on task cancellation, parent cancellation, and provider disposal - 17 new tests for BackgroundTaskRunner, all existing tests pass Issue #12330
…nd timeouts - Add BackgroundTaskRunnerCallbacks interface with onTaskTimeout and onTaskError - Wire VS Code notifications in ClineProvider: info on completion, warning on timeout/error - Document auto-approval design decision for read-only background tasks - Add 2 new tests for callback invocation (19 total, all passing)
Adds a collapsible Background Tasks Panel to the chat sidebar that shows active and recently completed background tasks. This builds on the Phase 4 BackgroundTaskRunner to give users visibility into background work. Key changes: - BackgroundTaskStatusInfo type for exposing task status to the webview - BackgroundTaskRunner tracks completed tasks with result summaries - BackgroundTaskRunner.getTasksStatus() returns combined active + completed - BackgroundTaskRunner.onStateChanged callback for UI refresh - backgroundTasks field added to ExtensionState and getStateToPostToWebview - cancelBackgroundTask webview message handler - postBackgroundTasksToWebview() for lightweight status-only updates - BackgroundTasksPanel React component with collapsible panel, cancel buttons, active count badge, and result summaries - 31 backend tests (BackgroundTaskRunner) + 7 UI tests (panel component)
|
@roomote Thanks for the clear PR description and the well-structured MVP scope. I agree with keeping Phase 5 strictly within the boundaries you listed:
The clear separation between “Included” and “Deferred to Phase 6+” is very helpful for scope control. Let’s stick to this MVP for now. A few points I’d like to align on before proceeding with review:
If we can first confirm the scope and content of the result summary, the rest should be straightforward. Would you be able to share a quick screenshot or example of what the result summary currently displays in the preview? That would help me understand the current implementation. I’ll also review Phase 4 (#12342) shortly. It probably makes sense to get Phase 4 merged first before we finalize Phase 5, to keep the dependency clean. Thanks for the work on this! |
Addressed the review feedback: added two-click cancel confirmation, panel max-height scroll constraint (200px) to prevent vertical space competition, and Phase 6 extension-point comments in both BackgroundTaskRunner and BackgroundTasksPanel. All 31 backend + 7 UI tests pass, lint and type checks clean. |
…tension-point comments
|
@roomote-v0[bot] Thanks for the quick updates. The changes look good:
All tests still pass and the scope remains clean. A couple of small follow-ups:
Once these are confirmed, I’m comfortable moving forward. I’ll also review Phase 4 shortly so we can keep the dependency order clean. Thanks again! |
Here are the answers to both questions: 1. Phase 6 Extension-Point CommentsTwo blocks were added:
The backend comments focus on the data/infrastructure side (tool allowlist, callbacks, serialization, message exposure), while the frontend comments describe how the UI would evolve to consume those capabilities. Together they sketch a clean handoff path for context: the runner exposes 2. UX with 200px Constraint and 3+ Active TasksThe panel is usable with 3+ tasks. Here's the breakdown:
In short: 3 tasks display fully without scrolling, 5 tasks still fit, and beyond that the scroll behavior handles it cleanly. The UX is acceptable. |
|
@roomote-v0[bot] Thanks for the detailed answers to both questions. This is helpful. The Phase 6 extension-point comments you added are clear and well-aligned with the overall direction of parallel execution and context handoff. The backend and frontend notes together form a reasonable evolution path. The UX explanation for the 200px max-height constraint is also acceptable — 5 tasks fitting comfortably with smooth scrolling beyond that works for the MVP. At this point the implementation looks good and stays within the defined Phase 5 MVP scope. Please mark this PR as ready for review and request reviews from the code owners. Thanks for keeping the progress moving cleanly. |
Done. PR has been marked as ready for review and reviews have been requested from all code owners (@mrubens, @cte, @jr, @hannesrudolph, @daniel-lxs). |
|
Closing as part of PR restructuring per issue #12330. This work will be combined into the new Remaining Phases (4+5+6) PR with proper stacked branching. |
This PR attempts to address Issue #12330 (Phase 5: Background Tasks Panel UI).
Summary
Builds on top of the Phase 4 BackgroundTaskRunner (PR #12342) to add user-visible UI for background tasks. This closes the visibility gap where background tasks were previously completely webview-silent.
Phase 5 MVP Scope
Included:
Deferred to Phase 6+:
Key Changes
Types (
packages/types)BackgroundTaskStatusInfointerface for exposing task status to webviewbackgroundTasksfield onExtensionStatecancelBackgroundTaskmessage type onWebviewMessageBackgroundTaskRunner (
src/core/task/BackgroundTaskRunner.ts)getTasksStatus()returns combined active + completed tasks for the UIonStateChangedcallback for notifying the webview when tasks changeClineProvider (
src/core/webview/ClineProvider.ts)postBackgroundTasksToWebview()for lightweight status-only updatesbackgroundTasksincluded ingetStateToPostToWebview()handleBackgroundTaskComplete()passes result summary to the runneronStateChangedcallback wired to refresh the webviewWebviewMessageHandler
cancelBackgroundTaskhandler delegates tobackgroundTaskRunner.cancelTask()BackgroundTasksPanel (
webview-ui/src/components/chat/BackgroundTasksPanel.tsx)Testing
Feedback and guidance are welcome!
Interactively review PR in Roo Code Cloud