Repository navigation
Support isolation: "worktree" for delegate_task to a linked environment #31920
Replies: 6 comments 3 replies
|
I hit the same thing yesterday: an orchestrator spreading eleven packages over two linked Ubuntu machines got this refusal, then created the worktrees over SSH and registered each one as a separate project to get isolation. I implemented it in my fork:
It doesn't fetch the commit by SHA. Fetching an arbitrary SHA from origin depends on the host allowing it, so it relies on the branch instead. That's the one gap: a parent with unpushed commits still needs a push first. Happy to open this as a PR if the scope is approved. |
|
Update: after comparing the base semantics, I revised the candidate to preserve the parent checkout's exact commit, matching local isolation. The earlier destination-HEAD candidate is superseded. Revised candidate: 0ef1c6d3, based on upstream The handoff is: owner commits and pushes the task branch, the destination fetches it, then
This agrees with the parent-commit direction of the implementation above. The narrower difference is that it omits automatic branch fallback: Verification on Linux: three new remote-worktree cases fail on unchanged main; the candidate passes all affected checks (81 tests, 37 package typechecks, format/lint/knip/GraphQL). Real-Git qualification pushes the parent commit, advances the branch, fetches on a separate destination checkout, and proves that the child still uses the original SHA while preserving dirty destination files. Tests also cover missing commits, retry after fetch, launch replay and unborn-destination failure without a checkout fallback. Build and compiled CLI help pass. Independent source review found no issues. The model-facing eval dry run passed; paid model evaluation and a production cross-host provider turn remain unverified. The candidate is not installed in live services. Would maintainers approve this exact-SHA, pre-fetched scope for a focused PR? Happy to consolidate around the existing contributor's implementation rather than open competing PRs; I will wait for direction/scope approval before submitting. Implemented with GPT-6.1 Sol through the Codex harness in T3 Code. |
|
The cross-host qualification that was still missing: a real run between two linked machines, both Ubuntu 24.04 with T3 Code built from
Cases 1, 3 and 4 cover the exact-SHA contract of step 1. B's project root stayed on its own HEAD in every case, and only its remote-tracking ref moved when it fetched. One thing I noticed that's separate from this change: on B the children appear as top-level threads ( |
|
Note 🤖 GPT-6.1 Sol responding on behalf of jkp Independent two-host qualification of @glouno's exact-parent-SHA candidate: the delegated lifecycle works across a macOS sender and Linux receiver. I adapted the candidate to sender source Observed through a real thread-scoped MCP call:
The agent was a free deterministic ACP fixture that writes a file/reports HEAD or holds until cancelled. These are live transport, worktree and lifecycle checks, not paid Claude/Codex provider turns or network-outage recovery checks. The stock sender reproduced the explicit worktree refusal. With the patch, both affected suites passed all 113 tests; the changed-file check passed 115 tests plus format, lint, knip, GraphQL generation and affected typechecks. Service/real-Git tests additionally cover launch replay after the parent advances, missing bases and retry after the destination acquires the commit. This supports the focused scope already agreed above: exact parent SHA, destination already has that commit, no moving-branch or shared-checkout fallback, and no automatic commit/push. Automatic host placement is separate. Could a maintainer approve that scope for the existing contributor's focused PR? I'm contributing this verification here so it can accompany the consolidated submission. |
|
+1, this would help me a lot. I build a native iOS + Android app in a monorepo. My parent thread runs on my Windows PC (Android Studio + emulator) and hands the iOS half of each story to my linked Mac (Xcode + Simulator). Right now that iOS child has only two options:
With |
|
+1, ran into this today. I have an agent thread on a Linux server that hands work to a linked Mac, because one of the providers I use is only turned on over there. Some of it is long implementation work and some is PR review.
The Mac's root checkout is out, since I work in it myself and a reviewer has to check out the PR branch. So I did what the error says and used Worktree isolation on the remote side, with the completion wake and |
Uh oh!
There was an error while loading. Please reload this page.
Problem. Local
delegate_tasksupportsisolation: "worktree", which gives each child a clean checkout. For a linked environment it is rejected (RemoteDelegation.ts#L210-L222):So remote children share, and can disturb, the project's root checkout on that machine: a branch switch or uncommitted files leak into the next task. Today the child has to be told to create its own git worktree by hand. The suggested alternative (
t3_thread_launchwith a worktree workspace strategy) creates a top-level thread instead of a delegated child, so there is no parent wake-up or result handoff.Idea. Support
isolation: "worktree"for linked environments the same way as locally: fetch the base on that machine, create the worktree there, and run the child in it.Related: discussion #31666 (run a child in an existing worktree). Observed on t3 v0.1.8-nightly.20261106.4247.
All reactions