Skip to content

feat: parallel task introspection, orphan detection, error handling & telemetry#12186

Open
DavinciDreams wants to merge 7 commits intoRooCodeInc:mainfrom
DavinciDreams:moo-code-standalone
Open

feat: parallel task introspection, orphan detection, error handling & telemetry#12186
DavinciDreams wants to merge 7 commits intoRooCodeInc:mainfrom
DavinciDreams:moo-code-standalone

Conversation

@DavinciDreams
Copy link
Copy Markdown

@DavinciDreams DavinciDreams commented Apr 25, 2026

Summary

  • Introspection APIgetParallelTaskStatus(taskId) on TaskProviderLike returns a snapshot of a task's parallel queue: queued tasks, completed results (with error fields), and the active child ID. Useful for debugging and future UI panels.
  • Worktree orphan detectiondetectAndCleanOrphanedWorktrees() runs in the background on extension activation, scans history for worktrees that still exist on disk after their tasks completed (e.g. after a crash), emits telemetry, and offers a VS Code cleanup notification.
  • Error propagation + abortOnChildFailurereopenParentFromDelegation now accepts a childFailed flag; SpawnParallelTasksTool accepts abortOnChildFailure: boolean; when set, a failing child abandons the remaining queue and returns partial aggregated results immediately.
  • Worktree naming — worktree paths and branch names now embed the last 8 chars of the parent task ID (project-a1b2c3d4) instead of a random suffix, making manual ls ~/.roo/worktrees/ inspection readable.
  • Telemetry — 6 new events: WORKTREE_CREATED, WORKTREE_DELETED, WORKTREE_ORPHAN_DETECTED, PARALLEL_TASK_SPAWNED, PARALLEL_TASK_COMPLETED, PARALLEL_TASK_CHILD_FAILED with matching TelemetryService capture methods.
  • Schema additionsparallelResults items gain error?: string; HistoryItem gains abortOnChildFailure?: boolean; parallelQueue items gain abortOnFailure?: boolean.

Test plan

  • Spawn parallel tasks with abortOnChildFailure: true and verify queue is abandoned on first failure
  • Let a parallel task's worktree get left behind (kill VS Code mid-run), restart — verify orphan notification appears
  • Confirm worktree directories are named <project>-<8-char-taskId> not random suffix
  • Call getParallelTaskStatus() on a running delegated task and verify returned snapshot
  • Check new telemetry events fire in output channel logs when worktrees are created/deleted

🤖 Generated with Claude Code

Interactively review PR in Roo Code Cloud

DavinciDreams and others added 6 commits April 23, 2026 08:20
- Strip all telemetry (PostHog, cloud telemetry) - no data leaves the machine

- Disable all cloud features (auth, settings sync, sharing, Roo provider)

- Rebrand extension: roo-cline -> moo-code, RooVeterinaryInc -> moo-code

- Update all commands, settings, views to moo-code.* prefix

- Remove upstream CI/CD workflows (marketplace publish, nightly, website)

- Rewrite README, PRIVACY, CONTRIBUTING, SECURITY docs

- Build verified: bin/moo-code-3.52.1.vsix (31.44 MB)
- Update all cloud package tests to match no-op implementations
- All 171 tests now pass
- Update src/package.json repository URL and homepage to point to actual fork
…upport

- Port session memory compaction, microcompact, hooks system, and
  prompt-too-long retry from the Claude Code CLI source
- Add spawn_parallel_tasks tool with serial queue drain fan-out pattern
- Add worktree isolation: new_task/spawn_parallel_tasks accept a worktree
  param; ClineProvider creates/cleans up git worktrees per child task
- Add completionPayload: attempt_completion result parsed as JSON and
  aggregated across parallel tasks for structured fan-in
- Fix workspacePath priority so explicit override always wins over parent
- Emit TaskSpawned event from delegateParentAndOpenChild
- Scope MCP hub to per-task workspacePath for worktree-aware mcp.json
- Fix microCompact bugs: touched flag, off-by-one threshold, keepRecent:0
- Fix lazy OutputChannel init in hooks executor to avoid test failures
- Fix pre-existing lint warnings across src, packages/cloud, webview-ui

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…and telemetry

- Introspection API: add ParallelTaskStatus type and getParallelTaskStatus() on
  TaskProviderLike so callers can list active child, queued tasks, and completed
  results (with errors) for any task ID
- Worktree orphan detection: detectAndCleanOrphanedWorktrees() scans history on
  startup, emits telemetry for each find, and offers a VS Code cleanup prompt
- Error propagation: reopenParentFromDelegation accepts childFailed flag; when
  abortOnChildFailure is set on the parent the remaining parallel queue is
  abandoned and partial results returned immediately
- abortOnChildFailure option: SpawnParallelTasksTool forwards the flag through
  delegation so callers can opt into fail-fast queue behaviour
- Worktree naming: worktree paths and branches now embed the last 8 chars of the
  parent task ID (e.g. project-a1b2c3d4) instead of a random suffix, making
  manual inspection easy
- Telemetry: six new events — WORKTREE_CREATED, WORKTREE_DELETED,
  WORKTREE_ORPHAN_DETECTED, PARALLEL_TASK_SPAWNED, PARALLEL_TASK_COMPLETED,
  PARALLEL_TASK_CHILD_FAILED — with matching TelemetryService capture methods
- error field on parallelResults items and abortOnChildFailure on HistoryItem
  schema so failure context survives process restarts

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@dosubot dosubot Bot added size:XXL This PR changes 1000+ lines, ignoring generated files. Enhancement New feature or request labels Apr 25, 2026
- Fix HTTP-Referer URLs to point to DavinciDreams/Morse-Code
- Update src/package.json repository and homepage URLs
- Replace WeakRef<any>/setProvider(any) with typed TelemetryPropertiesProvider interface
- Remove dead AbortController boilerplate from RetryQueue.retryRequest
- Fix WebAuthService.initialize() to emit auth-state-changed event (fixes webview spinner)
- Fix nightly esbuild PKG_NAME to match stable so commands resolve correctly
- Fix .gitignore corruption (remove backtick-nnul, add proper 'nul' entry)
- Update .roo-hooks.json.example branding to Morse Code
- Update all stale test assertions (HTTP-Referer, X-Title, User-Agent)
- Add docs/cloud-backend.md — implementation plan for future cloud feature branch
- Add scripts/build-pr.js — PR test build tool with nightly slot support
- Update scripts/install-vsix.js branding

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement New feature or request size:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant