Repository navigation
Description
Operating system
macOS
Orca version
1.4.182
Details
Summary
orca orchestration worker-start / dispatch --inject and orca terminal send --text ... --enter frequently deliver the prompt into the spawned agent's composer without it ever being submitted. The CLI reports a successful send (bytes accepted), but the agent (Claude Code in our case) sits idle indefinitely with the full prompt visible in its input field. From the coordinator's side this is indistinguishable from a slow worker, so orchestrators wait, then respawn — and the respawned worker hits the same thing.
Environment
- macOS (Apple Silicon, M4) — Darwin 25.5.0
- Orca 1.4.182 (also observed on earlier 1.4.x builds over the past several days)
- Workers: Claude Code agents launched via
orca orchestration worker-start --task <id> --worktree current --agent claude --model opus
Reproduction
orca orchestration run-create+task-create(spec ~1.5-2.5 KB)orca orchestration worker-start --task <id> --worktree current --agent claude --model opus --json→ returns dispatch + terminal handle,dispatch_input: accepted- Observe the worker terminal: the injected preamble+spec sits in the Claude composer, never submitted. No error anywhere.
- Manually pressing Enter in the terminal (or
orca terminal send --terminal <handle> --enter) submits it and everything proceeds normally.
Frequency: intermittent but frequent — multiple times per day across different sessions/worktrees for the past several days.
What it is NOT
- Not the update-available modal (terminal send --enter can be swallowed by update-available modal #13805): this has been reproducing for days; the update modal only appeared on our machine today, long after dozens of occurrences. Most repros had no modal present.
- Not the large-payload paste issue ([Bug]: dispatch --inject to Codex never submits large payloads — trailing Enter is concatenated into the bracketed-paste PTY write (v1.4.159) #11343): our payloads are well under the ~4.5 KB threshold reported there, and the target is Claude, not Codex.
- Not a TUI-booting race: it reproduces after
terminal wait --for tui-idleis satisfied and the agent is fully interactive.
Impact
Silent orchestration deadlock: check --wait never receives worker_done, coordinators burn their timeout, and users conclude workers are dead. We now unconditionally send a follow-up bare Enter and verify via worker-read (source: "transcript" vs "terminal") after every dispatch, which works but shouldn't be necessary.
Related
#10662 (confirmed-send primitive) and PR #13763 (honest submit verdict) would both mitigate this — an honest verdict at send time is exactly what's missing.
Activity
Tauri-EPO commentedon Aug 16, 2026
Same failure on Windows dogfooding of unattended Claude /
cursor-agentworkers (also #14505; the closed #14525 came back). Coordinator seessend/dispatch --injectsuccess; the prompt sits in the composer; the worker never starts.Runtime already knows the Enter can be swallowed and currently recovers with a blind 500ms
\r, not a delivery check:That timer reports success even when the composer still holds the draft. Cursor Agent is explicitly not auto-submitted (
isCursorAgentOrchestrationTargetreturns before the timer), socursor-agentworkers launched via.cmdnever get an Enter from this path at all.#10662 / PR #13763 (honest submit verdict) is the right primitive. Until inject/send is verify-then-retry, coordinators cannot tell “unsubmitted draft” from “thinking.”
OrcaWin commentedon Aug 16, 2026
Related: #14505 is the same unsubmitted-inject symptom on packaged Windows. #14342 (wait for Claude composer render) merged after v1.4.182 and is in v1.4.183, but this report is on v1.4.182 and explicitly rules out a TUI-boot race (
tui-idlealready satisfied; also reproduces on laterterminal send --enter). Leaving open — not a confident "already fixed in 1.4.183" match. A retest on latest would help.mestrecs commentedon Aug 21, 2026
Retest on v1.4.187 (latest): still present. Adding the bundle-level root cause and a patch we have been running in production for 3 days, since @OrcaWin asked for a retest on latest.
We hit this 10 times in 5 days on Windows 11 (7 on one day, 3 on another) with Claude Code workers and preambles of ~4–6 KB, on
1.4.184(packaged Windows x64, ConPTY, several agent terminals live at once).Still unfixed on latest
Checked against the source at tag
v1.4.187:src/shared/agent-prompt-injection.tsstill submits on a fixed timer —WINDOWS_AGENT_PROMPT_SUBMIT_DELAY_MS = 1_500,DEFAULT_AGENT_PROMPT_SUBMIT_DELAY_MS = 500;confirmAgentPromptSubmitted).So
#14342(wait for Claude composer render, in1.4.183) narrowed the boot race but did not close this one, which matches the report: it reproduces aftertui-idleis satisfied.Root cause, at line level
All references to
out/main/index.jsinsideresources/app.asar(unminified in the shipped build).1. The submit is blind and time-based —
writeTerminalAgentPrompt(~197427):The delay is measured from "we finished writing bytes to the pty", not from "the TUI finished consuming the paste". Those are different clocks: a 4–6 KB paste through ConPTY on a busy machine can still be in flight after 1500 ms. When it is, the
\rlands inside theESC[200~ … ESC[201~window and the TUI treats it as pasted text — which is exactly the extra blank line you see in the composer.2. Delivery is never verified —
worker-start(~87945):state: "accepted"is unconditional — the only evidence behind it is that a PTY write did not throw. Note the asymmetry: the code does wait fortui-idlebefore sending (~87921), but never checks that the terminal left idle afterwards, which is precisely the observable that separates success from this failure.The decision-gate preamble (~83881), re-dispatch (~88654) and
send --preamble(~89572) all go through the samesendTerminalAgentPromptfunnel, so all four paths share the defect — and would share a fix.Making it deterministic
Temporarily lower
WINDOWS_AGENT_PROMPT_SUBMIT_DELAY_MS(e.g. to 50). The failure becomes reliable, which is what confirms it is a race against paste ingestion rather than a TUI-boot race.The patch we run
Patched at the
sendTerminalAgentPromptlevel so all four call sites are covered (+1048 bytes, 3 hunks). Verify-and-resubmit while the terminal is still idle:Two properties worth keeping in whatever you land:
\rwhen the status ispermission. A blind Enter on a permission dialog would silently accept it. Onlyidleshould trigger a re-submit;null/unknown should do nothing.\ron an empty composer is a no-op, which is what makes the retry safe.Result on our side: since applying it, 7+ consecutive dispatches submitted on their own with no manual Enter, on the same machine and the same workload that was failing several times a day.
The part that actually cost us the time
Even with a retry, a dispatch that was never consumed should not be recorded as ready.
dispatch_input: acceptedon bytes-written alone is what turned all 10 of our incidents from visible into silent — there was nothing to alert on and nothing to retry, because every participant believed the handoff had happened. Marking itunverified, or even just logging it, would have been enough.#10662/ PR#13763(honest submit verdict) is the right primitive for this half.An adaptive delay scaled by payload size would narrow the race but cannot close it; only an observation of the terminal state can.
Tauri-EPO commentedon Aug 22, 2026
Two corrections to the v1.4.187 retest above, plus one thing it surfaced that is now being reported separately. Everything below is checked against the tag rather than against
main.The verification layer does exist at v1.4.187
That symbol is not there, but the layer is — under a different name:
It sits immediately after the
\r, inside the same funnel this report identifies:and it polls for up to
AGENT_PROMPT_EFFECT_TIMEOUT_MS = 5_000looking forcurrent.workingSequence > baseline.workingSequence, throwingagent_prompt_stalledwhen the agent never starts working. It arrived with #14962, merged 2026-08-17 and released in v1.4.187. The line-level analysis above is from the1.4.184asar, which predates it.dispatch_input: acceptedis no longer unconditional in effectThe line is still written unconditionally in source at v1.4.187 (
orchestration-workers.ts:236), but it is unreachable when submission fails, because theawaitabove it rejects:So the half of this report that made the incidents silent — "every participant believed the handoff had happened" — is closed on v1.4.187.
worker-startnow returnsstate: failed,stage: dispatch_input,lastError: agent_prompt_stalled.The safety property is already implemented
That is
assertPromptNotBlockedin the same file: it throwsagent_prompt_blockedwhencurrent.status === 'permission'or the permission sequence has advanced since the baseline. Worth knowing if a resubmit is layered on top of it, since the guard is already there to compose with.What the retest gets right, and what the fix turned the failure into
The blind timer is unchanged.
WINDOWS_AGENT_PROMPT_SUBMIT_DELAY_MS = 1_500still measures from "we finished writing bytes", not "the TUI finished consuming the paste", so the race this report identifies still fires. The verification catches it after the fact; it does not prevent it. The conclusion that only an observation of terminal state can close this, not an adaptive delay, is unaffected by anything above.What did change is the shape of the failure, and it has its own cost. A dispatch that fails at
dispatch_inputrevokes its capability before anyworker_doneand leaves its agent terminal behind as aresidualResourcesentry, withworker-releaseable to answerrelease_unknown/tab_not_found. That is #15920 (macOS, filed today) and #15826 (Windows). On a released build the failure is no longer silent — it is loud, and it leaves a terminal that no CLI command can reclaim.None of this argues against the verify-and-resubmit direction proposed here. It does mean such a change would now compose with an existing verification step rather than introduce the first one, and that whatever lands should also say what happens to the residue when it gives up.
yoyofreeman commentedon Oct 22, 2026
Same failure class, Linux + OpenCode 2.1.3 (our case: text never even reaches the composer)
Reproducing this on Linux (Ubuntu 24.04), Orca 1.4.237, OpenCode 2.1.3 TUI, with
orca orchestration dispatch --task <id> --to <opencode-terminal-handle>(no--inject).Difference from the report: the spec text does not appear in the composer either — the
OpenCode TUI stays on its idle welcome banner (
Ask anything…). So it is one step furtheralong than "delivered but not submitted".
Evidence (two dispatches, same coordinator terminal, ~10 min apart)
worker-listsaysctx_59ecd1b1cf68(tasktask_32a76b08809c)[ready/done] liveness=live provider=opencode— looks greenworker-read --dispatch … --limit 12returns only the idle OpenCode welcome screen/tmp/threading-research.mdmissingctx_e5c4e69cb0de(tasktask_9421dab02e1a)[unsupervised/unknown] attention=failure,interruption liveness=exitedworker-read→No terminal output returned./tmp/xtool-eval/missingworker-readmetadata in both cases:The dispatch call itself returned success with
dispatch_input … state: "accepted".Why this is worse than a plain failure
state: "accepted"plusworker-list [ready]/[done]is read by coordinators as"dispatched and running". I acted on that reading and reported to a human that two
jobs were in flight; neither had started. The only signal that would have caught it is
checking for the expected artifact, which the contract does not require.
Suggestions (matching the ask in this issue)
buffer back and require the task text (or a hash of it) to appear. Only then report
dispatched; otherwise reportundeliveredwith the buffer excerpt.worker-list: add adeliveredfield distinguishing coordinator accepted fromagent session actually received it, so
[ready]stops being read as "running".keystroke/paste sequence than the Claude/Codex paths; pick it automatically instead of
making the caller guess (
--injectalso fails with the same "already has an activedispatch" guard in this scenario, so there is no working fallback).
assertion — the current
orca-subagentsflow impliesdispatchreturning OK is enough.Environment
1.4.237, OpenCode2.1.3(TUI, provideropencode, default free model), Linux x86-64.term_e9a…) in the same Orca instance; workspace/home/leon/studio/devel/cellforth.pi --version1.4.0.Local record: our own issue tracker entry
issue_20261023010848_8a13(repo-side evidence +repro steps) — happy to attach more logs if useful.
hgijeon commentedon Dec 1, 2026
I hit what looks like the same symptom (macOS, Claude worker, brief typed but never submitted, intermittent) and traced one concrete cause (it explains only part of my failures; see below).
Mechanism. On exit, Node.js unconditionally writes the termios it saw at startup back to a tty stdio, even when it is a background process (nodejs/node#66753 fixes this on
main; not in a release yet). If a shell startup script runs a Node-based CLI in the background with the terminal inherited, and that process starts in the few tens of ms before Claude enables raw mode, its exit puts the tty back into canonical mode under Claude. After that, the kernel echoes the pasted brief and ICRNL turns Orca's Enter (\r) into\n, which Claude treats as a newline, not submit. Orca then reportsturn_start_unobserved.Evidence.
icanon echo icrnl) while Claude was running, and in both an Orca CLI process (orca account list --json, invoked by a status script from.zshrc) exited at the raw→cooked flip. The other 3 stayed in raw mode with[Pasted text #1 +171 lines]left in the composer, so they are a different cause that this does not explain.claudestarts leaves the tty cooked in 4/4 runs, and the brief is not submitted in 3/3. Detaching the same process (</dev/null >/dev/null 2>&1) gives 0/4 and 3/3 submitted.Workaround. Detach background jobs in shell startup files from the terminal.
Note for Orca. The bundled Orca CLI runs on Electron's Node, so it is one such process until the bundled Node includes nodejs/node#66753.