FileMailbox implements IMailboxService using a JSON file per agent
with proper-lockfile for concurrent-write safety. Polling replaces
the EventEmitter used by InMemoryMailbox.
- FileMailbox: ~/<baseDir>/<safe-agentId>.json, 500ms poll interval
- Race-safe inbox creation via exclusive O_EXCL write (flag "wx")
- MailboxManager: createFileMailbox(sessionId, baseDir?) alongside
existing createMailbox(); map type widened to IMailboxService
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Workers that are running concurrently (parent still alive in task Map)
now route tool-approval through LeaderPermissionBridge instead of
surfacing a UI prompt on the hidden worker task.
- LeaderPermissionBridge: module-level singleton, register/submit/dialog
- presentAssistantMessage: intercept askApproval for concurrent workers
- ClineProvider: register showWorkerPermissionDialog on construction
- events/task.ts: PermissionRequested + PermissionResolved event types
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Infrastructure:
- IMailboxService interface (abstraction over in-process and future file backends)
- InMemoryMailbox: EventEmitter-based, instant delivery, configurable timeout fallback
- MailboxManager: per-session mailbox lifecycle + assignTask/shutdownWorker/
waitForNextMessage/notifyIdle helpers
Events:
- WorkerIdle [sessionId, taskId] — emitted when a persistent worker finishes a turn
- WorkerShutdown [sessionId, taskId] — emitted when a worker receives shutdown_request
Idle loop (opt-in via persistent:true on spawnConcurrentChildren):
- spawnConcurrentChildren gains persistent?: boolean param; creates/destroys mailbox
- AttemptCompletionTool concurrent path: if session has an active mailbox, sends
idle_notification and awaits task_assignment or shutdown_request (5-min safety
timeout). On task_assignment: pushes new task context and returns "reassigned"
so the LLM loop continues without resolving the parent Promise. On shutdown or
timeout: resolves normally. TaskCompleted is NOT emitted for reassigned workers.
- DelegationProvider interface gains swarmRegistry, mailboxManager, emit fields
Public API on ClineProvider:
- assignTaskToWorker(sessionId, workerId, message): sends task_assignment
- shutdownWorkers(sessionId): broadcasts shutdown_request to all session workers
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- packages/types/src/swarm.ts: AgentColorName, AgentIdentity, SwarmSession,
TeammateMessage stubs (P3)
- packages/types/src/history.ts: add swarmSessionId, agentId, agentName,
agentColor, isSwarmLeader fields to HistoryItem schema
- packages/types/src/events.ts: add SwarmSessionStarted, SwarmSessionEnded,
WorkerRegistered events to RooCodeEventName, rooCodeEventsSchema, taskEventSchema
- packages/types/src/task.ts: add swarm events to TaskProviderEvents so ClineProvider
emit calls are properly typed
- src/core/swarm/SwarmRegistry.ts: round-robin color assignment, session lifecycle
- ClineProvider: add SwarmRegistry field; spawnConcurrentChildren now creates a
session, assigns agentName/agentColor/agentId to each worker's HistoryItem,
marks parent as isSwarmLeader, emits SwarmSessionStarted/WorkerRegistered/
SwarmSessionEnded; accepts optional role field in task spec
- RunTeamPhaseTool: pass role through to spawnConcurrentChildren
- SubtaskRow: render 8px color dot (with tooltip showing agentName) when
agentColor is set on a history item
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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>
- 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
* 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
In CLI runtime, stdin harnesses expect command lifetime to be governed
solely by commandExecutionTimeout (user setting), not model-provided
background timeouts. Extract resolveAgentTimeoutMs() and return 0 when
ROO_CLI_RUNTIME=1.
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
fix: forward task configuration through stdin-prompt-stream protocol
The stdin-prompt-stream `start` command only accepted `prompt` — any
`configuration` passed via the cloud worker's StartNewTask was silently
dropped. This meant custom modes (e.g. `ask-artifacts`), disabled tools,
and other task-level settings never reached the extension when running
via the CLI harness.
Changes:
- Add optional `configuration` field to the `start` stdin command
- Parse and forward it in `runStdinStreamMode`
- Thread it through `ExtensionHost.runTask` → `newTask` webview message
→ `ClineProvider.createTask` (which already calls `setValues`)
- Add `taskConfiguration` field to `WebviewMessage` type
Backward-compatible: older CLIs ignore the extra field; older workers
that don't send `configuration` trigger no change in behavior.
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: cte <cestreich@gmail.com>
* fix(cli): streaming deltas, task ID propagation, cancel recovery, and misc fixes
- Stream tool_use ask messages (command, tool, mcp) as structured deltas
instead of full snapshots in json-event-emitter
- Generate task ID upfront and propagate through runTask/createTask so
currentTaskId is available in extension state immediately
- Wait for resumable state after cancel before processing follow-up
messages to prevent race conditions in stdin-stream
- Add ROO_CODE_DISABLE_TELEMETRY=1 env var to disable cloud telemetry
- Provide valid empty JSON Schema for custom tools without parameters
to fix strict-mode API validation
- Skip paths outside cwd in RooProtectedController to avoid RangeError
- Silently handle abort during exponential backoff retry countdown
- Enable customTools experiment in extension host
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: add start() to TaskStub in single-open-invariant test
The ClineProvider.createTask change to call task.start() after
addClineToStack requires the test's TaskStub mock to have this method.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
* changeset version bump
* Revise CHANGELOG for recent version updates
Updated changelog for versions 3.50.4 to 3.48.0, including new features, fixes, and improvements.
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Matt Rubens <mrubens@users.noreply.github.com>
* feat: add MiniMax M2.5 model and set as default
* fix: update MiniMax M2.5 contextWindow to 204_800
* Delete .changeset/add-minimax-m25.md
---------
Co-authored-by: Roo Code <roomote@roocode.com>
Co-authored-by: Matt Rubens <mrubens@users.noreply.github.com>
* feat: restore Unbound as a provider
* Adds translations
* fix: add unbound to ClineProvider test expectations
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Pass --template="" to git init and strip GIT_TEMPLATE_DIR from the
environment so system/user git hooks and other template files never
get copied into the shadow repository used for checkpoints.
Co-authored-by: Roo Code <roomote@roocode.com>
* fix(bedrock): enable prompt caching for custom ARN and default to ON
- Set supportsPromptCache to true for custom-arn model info in useSelectedModel.ts
- Change awsUsePromptCache default from false to true using nullish coalescing
- Add tests for custom-arn prompt caching support
Closes#10846
* fix(bedrock): align backend awsUsePromptCache default with UI (?? true)
The backend treated undefined awsUsePromptCache as falsy (OFF) while the
UI checkbox defaulted to true via nullish coalescing. This caused the UI
to show prompt caching as ON but the backend to keep it OFF for new users.
Apply the same ?? true default in the backend so both sides agree.
---------
Co-authored-by: Roo Code <roomote@roocode.com>