Repository navigation
feat(server): delegated subagents can run in their own worktree - #168
Merged
Merged
Conversation
delegate_task takes an optional workspaceStrategy (worktree or existing_worktree, t3_thread_launch's shapes). The child's first run is created in preparing and ThreadLaunchService prepares and binds that workspace exactly as a launch does before releasing it, so the child stays the caller's lineage subagent while running in a separate checkout. Preparation failures fail the task with the reason; a full-access/default caller is required, as for t3_thread_launch. Omitting it keeps sharing the parent's checkout. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
delegate_taskalways ran the child in the caller's checkout, so a subagent doing independent implementation work would edit the same files as its parent. The only way to get a separate worktree wast3_thread_launch, which creates an unrelated top-level thread instead of a subagent.delegate_tasknow takes an optionalworkspaceStrategywith the sameworktree/existing_worktreeshapes ast3_thread_launch. The child's first run starts inpreparing, andThreadLaunchServiceprepares and binds the workspace exactly as a launch does before releasing it. The child stays the caller's subagent in its lineage while it works in its own checkout. If preparation fails, the task fails with the reason. As witht3_thread_launch, the caller needs full-access/default mode. Leaving the field out keeps today's behaviour of sharing the parent's checkout.Tool descriptions, agent instructions,
docs/fork-differences.md, the orchestrator MCP doc and the agent-access user guide are updated.ThreadLaunchService.test.tscovers the new path.Built by Claude Opus 5.5 (1M context) in Claude Code, running in T3 Code.
🤖 Generated with Claude Code