Skip to content

feat(server): delegated subagents can run in their own worktree - #168

Merged
adampeterhiggins merged 1 commit into
mainfrom
t3code/delegate-task-worktree
Oct 6, 2026
Merged

adampeterhiggins merged 1 commit into
mainfrom
t3code/delegate-task-worktree

Conversation

@adampeterhiggins

Copy link
Copy Markdown
Owner

delegate_task always 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 was t3_thread_launch, which creates an unrelated top-level thread instead of a subagent.

delegate_task now takes an optional workspaceStrategy with the same worktree / existing_worktree shapes as t3_thread_launch. The child's first run starts in preparing, and ThreadLaunchService prepares 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 with t3_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.ts covers the new path.

Built by Claude Opus 5.5 (1M context) in Claude Code, running in T3 Code.

🤖 Generated with Claude Code

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant