Three targeted fixes:
1. Tool schema: add concurrent and abortOnChildFailure params to
spawn_parallel_tasks so the LLM can discover and use them. Update
description to explain sequential vs concurrent trade-offs.
2. Mode-switch race: spawnConcurrentChildren was using tasks.map(async)
which ran all handleModeSwitch calls concurrently, causing each child
to read whatever mode happened to win the race. Rewrite to a sequential
for-loop for setup (mode switch + createTask), then a tight sync loop
for all child.start() calls so execution is still concurrent.
3. abortOnChildFailure for concurrent mode: when a child rejects and the
flag is set, immediately abort all sibling tasks via removeClineFromStack
and reject their completion Promises. Previously this flag was only
wired for the sequential queue-drain path.
Add 7 unit tests covering: aggregated results, serialised mode switches,
simultaneous start ordering, per-child error collection, sibling abort,
event emission, and worktree creation.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace the LIFO `clineStack: Task[]` with a flat `tasks: Map<string, Task>`
(+ `focusedTaskId`, `leaderTaskId`, `childCompletionHandlers`) so multiple
tasks can be registered simultaneously — the prerequisite for true concurrent
fan-out.
Key changes:
- ClineProvider: swap all 19 clineStack usages; add `getTaskById()`,
`spawnConcurrentChildren()`, `resolveChildCompletion()`
- SpawnParallelTasksTool: add `concurrent?: boolean` flag; concurrent path
awaits Promise.all via spawnConcurrentChildren instead of queue drain
- AttemptCompletionTool: detect concurrent vs sequential by checking whether
parent is still alive in the tasks map; route to resolveChildCompletion
(concurrent) or reopenParentFromDelegation (sequential)
- Tests: update three spec files that accessed clineStack directly
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Captures the full architecture plan for moving Moo Code from sequential
task delegation to genuine concurrent in-process swarm, modelled on the
claude-code teammate/swarm implementation.
Phases:
P1 - Replace clineStack with concurrent tasks: Map, remove single-open invariant
P2 - SwarmRegistry, AgentIdentity, round-robin color assignment
P3 - InMemoryMailbox, idle worker loop, task_assignment/idle_notification
P4 - LeaderPermissionBridge, worker badge in tool-ask UI
P5 - FileMailbox with lockfile for cross-process workers
P6 - CliWorkerBackend, moo-worker entry point, spawn_swarm tool
Includes data model changes, new event names, updated API surface for
spawn_parallel_tasks (concurrent flag) and new spawn_swarm tool spec,
UI changes, phased delivery estimates, and risk/mitigation table.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- 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>
- 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>
- 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
feat(bedrock): add Cohere Embed v4 model and improve credential handling
- Add cohere.embed-v4:0 (1536-dim) to Bedrock embedding model profiles
- Add v4-specific request format (embedding_types: ["float"]) and response
parsing (embeddings.float[0]) in BedrockEmbedder
- Replace fromEnv() with fromNodeProviderChain() for default credential
chain when no AWS profile is specified, supporting SSO, IMDS, ECS, and
other credential sources with built-in memoization
- Add unit tests for Cohere v4 request/response handling, credential
provider selection, and v3 regression coverage
Fixes#11823
feat(cli): add create-with-session-id support
rename public task id flag to --create-with-session-id
validate session ids as UUIDs for create/resume and stdin start.taskId
add integration coverage for create+resume loading correct session
* Allow selecting a specific shell
Add --terminal-shell CLI flag to specify which shell ExecaTerminalProcess
uses for inline command execution. The shell path is validated at the CLI
layer and passed through the standard settings mechanism (BaseTerminal
static getter/setter), matching how all other CLI terminal settings flow
through the system.
* test(cli): make shell path access test cross-platform