You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
on large checkout drops runtime connection after creating git worktree (orphan leak) #20108
orca worktree create against a large repo checkout (~700MB, includes node_modules) fails with runtime_unavailable ("The Orca runtime closed the connection before responding") — but the git worktree has already been created by the time the connection drops, so every attempt leaks an orphan worktree that must be cleaned up by hand.
Repro
orca worktree create --repo id:<repo> --name <name> --no-parent --setup skip --json
# => {"ok": false, "error": {"code": "runtime_unavailable", "message": "The Orca runtime closed the connection before responding. Restart Orca and try again."}}
git worktree list # the new worktree IS present despite the error
Same command against a small repo (760KB) on the same host, same daemon, same runtime succeeds. worktree list, worktree current, terminal create, and orchestration dispatches all work normally throughout — only create-on-large-checkout drops.
Environment
Orca 1.4.200, daemon protocol v36, macOS arm64, local runtime (ready/reachable before and after)
Large repo: ~702MB working copy with node_modules; small repo: 760KB
Expected
Either the create completes, or it fails atomically (no git worktree left behind), or it fails with a specific error (timeout/scan budget) instead of a generic connection drop.
Actual
Connection drops mid-create, deterministically reproducible on the large repo.
Orphan worktrees accumulate across retries; each removes cleanly afterwards with orca worktree rm --force, so removal paths are fine — only create is affected.
Impact on automation
CLI/automation callers cannot distinguish this from a total failure and will retry, accumulating orphans. A bounded create with either atomic rollback or a distinct error code would let callers handle it safely.
Related prior art from the mirror: 1268fb5 (#17388, Aug 30) fixed the variant where create verification failed against a softened listing failure. This report is the cousin that fix didn't cover — git confirms AND lists the worktree fine (plain git worktree list shows it immediately); what dies is the daemon connection itself, mid-create, deterministically on a ~700MB checkout while a 760KB repo on the same daemon succeeds. Smells like a post-create step (scan/index) exceeding a response budget rather than a git failure.
I can reproduce this on Windows 11 with Orca 1.4.215, native CLI, on a ~720 MiB repo (~7.4k tracked files). The worktree, branch, comment/linked issue and agent terminal are all created, only the CLI response is lost.
Timeline for a stripped-down call (--setup skip, no --agent, no --prompt):
09:19:40Z CLI exits 1 with runtime_unavailable ("closed the connection before responding"), 33.4s after start
09:19:40Z git creates the branch (branch reflog)
~09:20:50Z git releases the initializing lock on the new worktree
The daemon PID and runtime id are the same before and after, so the runtime did not restart. With --setup run --agent claude --prompt ... the result is the same; the agent terminal is created after the CLI has already failed.
From what I can tell, this looks like the 30s idle timeout on the runtime socket (named pipe on Windows) closing the connection while worktree.create is still running, since only long-poll methods arm keepalive:
If that's right, #22347 would cover this on Windows too, as the named-pipe path uses the same transport. Please correct me if I'm reading it wrong. Happy to test a build on Windows.
Observed the same ambiguous-create failure on macOS arm64 with Orca 1.4.217, then 1.4.218 (build 95e8725, daemon protocol 37).
The invoking agent reported two worktree create --repo id:<repo> --name <name> --no-parent --agent codex --prompt <redacted> calls ending in runtime_unavailable / connection closed, and initially saw no worktree. A receiving agent subsequently verified both git worktree list --porcelain and orca worktree list --json: the requested worktree did exist, and its Codex terminal was already actively processing the prompt. A fallback agent in the main checkout was running the same task. We stopped the duplicate before either performed writes.
Local trace evidence: a git.exec worktree operation with 7 arguments started at Unix timestamp 1790973888.258 and ran for 32,291 ms. Worktree-local configuration operations followed at 1790973920.549 and 1790973920.576. CLI-created metadata retained createdAt=1790973704446; the eventual worktree creation timestamp was 1790973920629. Runtime was ready/reachable when inspected afterwards; terminal create, list and read worked.
Additional bounded trace evidence from the same create window: git fetch took 60,032 ms and ended with GitCommandTimeoutError; subsequent git status and git reset spans took 61,100 ms and 61,160 ms respectively and succeeded. The final worktree operation then took 32,291 ms. This narrows the observed delay to Git operations but does not establish why the CLI socket closed.
This confirms delayed successful creation/agent startup after an apparent failure, rather than a reliable rollback. I have not independently proved the internal timeout cause; the outstanding #22347 looks relevant. Please include agent-launch/prompt delivery reconciliation in the fix so a caller can recover the original operation without starting a second owner. No private repository paths, task prompt, credentials or raw logs are attached.
Activity
aigentic-net commentedon Sep 11, 2026
Related prior art from the mirror: 1268fb5 (#17388, Aug 30) fixed the variant where create verification failed against a softened listing failure. This report is the cousin that fix didn't cover — git confirms AND lists the worktree fine (plain
git worktree listshows it immediately); what dies is the daemon connection itself, mid-create, deterministically on a ~700MB checkout while a 760KB repo on the same daemon succeeds. Smells like a post-create step (scan/index) exceeding a response budget rather than a git failure.AmethystLiang commentedon Sep 16, 2026
Thanks for reporting! We'll look into preventing worktree leaks when creation times out on large repositories.
cderv commentedon Sep 28, 2026
I can reproduce this on Windows 11 with Orca 1.4.215, native CLI, on a ~720 MiB repo (~7.4k tracked files). The worktree, branch, comment/linked issue and agent terminal are all created, only the CLI response is lost.
Timeline for a stripped-down call (
--setup skip, no--agent, no--prompt):worktree create --base-branch upstream/main --setup skip --no-parent --jsonruntime_unavailable("closed the connection before responding"), 33.4s after startinitializinglock on the new worktreeThe daemon PID and runtime id are the same before and after, so the runtime did not restart. With
--setup run --agent claude --prompt ...the result is the same; the agent terminal is created after the CLI has already failed.From what I can tell, this looks like the 30s idle timeout on the runtime socket (named pipe on Windows) closing the connection while
worktree.createis still running, since only long-poll methods arm keepalive:orca/src/main/runtime/rpc/unix-socket-transport.ts
Lines 120 to 122 in 2f8f4f5
If that's right, #22347 would cover this on Windows too, as the named-pipe path uses the same transport. Please correct me if I'm reading it wrong. Happy to test a build on Windows.
Related: #7410
jentor commentedon Oct 2, 2026
Observed the same ambiguous-create failure on macOS arm64 with Orca 1.4.217, then 1.4.218 (build 95e8725, daemon protocol 37).
The invoking agent reported two
worktree create --repo id:<repo> --name <name> --no-parent --agent codex --prompt <redacted>calls ending inruntime_unavailable/ connection closed, and initially saw no worktree. A receiving agent subsequently verified bothgit worktree list --porcelainandorca worktree list --json: the requested worktree did exist, and its Codex terminal was already actively processing the prompt. A fallback agent in the main checkout was running the same task. We stopped the duplicate before either performed writes.Local trace evidence: a
git.execworktree operation with 7 arguments started at Unix timestamp 1790973888.258 and ran for 32,291 ms. Worktree-local configuration operations followed at 1790973920.549 and 1790973920.576. CLI-created metadata retainedcreatedAt=1790973704446; the eventual worktree creation timestamp was1790973920629. Runtime was ready/reachable when inspected afterwards;terminal create, list and read worked.Additional bounded trace evidence from the same create window:
git fetchtook 60,032 ms and ended withGitCommandTimeoutError; subsequentgit statusandgit resetspans took 61,100 ms and 61,160 ms respectively and succeeded. The final worktree operation then took 32,291 ms. This narrows the observed delay to Git operations but does not establish why the CLI socket closed.This confirms delayed successful creation/agent startup after an apparent failure, rather than a reliable rollback. I have not independently proved the internal timeout cause; the outstanding #22347 looks relevant. Please include agent-launch/prompt delivery reconciliation in the fix so a caller can recover the original operation without starting a second owner. No private repository paths, task prompt, credentials or raw logs are attached.
fix(runtime): suspend the socket idle timeout while a dispatch is in …
fix(runtime): suspend the socket idle timeout while a dispatch is in …
fix(runtime): suspend the socket idle timeout while a dispatch is in …
AmoabaKelvin commentedon Nov 17, 2026
Fixed by #29262: the runtime connection stays open while a slow worktree create is still running.