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
agent_prompt_stalled: dispatch fails ~8s after launch for slow-booting agents (Hermes, agy) — worker completes task but worker_done rejected #16660
orca orchestration worker-start marks a dispatch failed with agent_prompt_stalled ~8 seconds after launch, before slow-booting agents (Hermes Agent CLI, Google Antigravity CLI agy) reach their first prompt. The worker agent then does complete the assigned task in its worktree and attempts orca orchestration send --type worker_done — but the send is rejected (exit 1) because the dispatch capability was already revoked. The task stays failed in the UI despite the work being done.
Environment
Orca v1.4.188, headless orca serve --pairing-address <tailscale-ip> on Ubuntu 24.04 (systemd, user dev)
Agents tried as workers, both hit the same issue:
Hermes Agent v0.20.5 (hermes --tui default launch, and hermes --cli via agentCmdOverrides) — boots in ~15–60s (Python venv, model init)
Antigravity CLIagy v1.1.21 (first-run onboarding prints help) — boots >8s
The dispatch should wait for the agent's first prompt longer than 8s (or the stall window should be configurable), so slow-booting agents like Hermes/agy can complete the dispatch_input stage. --timeout-ms 120000 on worker-start did not change the stall window.
Notes
Direct connectivity is fine: getUpdates-style API calls and agent one-shot invocations complete in <2s; the delay is purely agent startup (venv/init/onboarding).
Workaround attempt that did NOT help: settings.agentCmdOverrides = {"hermes": "hermes --cli"} (line-based CLI instead of TUI); dispatching to an already-running agent terminal via worker-start --terminal fails with agent_unconfigured unless the terminal was launched by Orca; dispatch --inject to a manually-started agent terminal was not accepted either.
Happy to provide logs/terminal captures or test a patch.
We patched the installed bundle (v1.4.188): AGENT_PROMPT_EFFECT_TIMEOUT_MS from 5e3 → 120e3 and repacked app.asar. Results:
The stall window now correctly waits 120s (dispatch dispatched_at 18:35:57 → completed_at 18:38:06 ≈ 129s). The timeout itself is not the (only) problem.
After 120s the dispatch STILL fails with agent_prompt_stalled — because verifyAgentPromptSubmission never observes workingSequence advancing past baseline.
The worker is demonstrably working the whole time: Hermes TUI shows progress (deepseek-v4-pro, 2% context, synthesizing) and the task IS completed in the worktree (README modified per the task spec). It even attempts worker_done (rejected, exit 1, capability revoked after the stall).
Suspected root cause
Hermes has the Orca-managed status-hook plugin installed (~/.hermes/plugins/orca-status, reports on_session_start/pre_llm_call/post_llm_call/... via ORCA_AGENT_HOOK_ENDPOINT), and the runtime's readActivity() for hermes maps pre_llm_call/on_session_start to working-sequence advancement. In the dispatched-worker launch (hermes --tui --yolo + injected preamble), the LLM clearly runs (UI shows synthesizing), yet no activity advance is observed — suggesting the hook events either don't fire in that launch context or their reporting to the hook endpoint is failing (e.g., env not propagated to the dispatched PTY, or the plugin is skipped in this mode).
Request
Would it be possible to make the prompt-verification either (a) fall back to terminal output activity (any new bytes since baseline) when agent status hooks are unavailable/silent, or (b) expose AGENT_PROMPT_EFFECT_TIMEOUT_MS via env/setting? Both would make slow-booting or hook-silent agents (Hermes, agy) usable as dispatched workers. Happy to test a patch or provide the hook logs.
After extensive local testing (all with the 120s AGENT_PROMPT_EFFECT_TIMEOUT_MS bundle patch), the complete causal chain for Hermes as a dispatched worker:
What works
Preamble injection works with the ORIGINAL launch (hermes --tui --yolo): the worker receives the full 91-line preamble, performs the task in the worktree, and attempts worker_done. README modified correctly in every run.
The worker's own forensics confirmed: the dcap_ capability token is minted at dispatch and embedded ONLY in the preamble text (dispatch_contexts stores its sha256). With the original launch the token reaches the agent via the startup query path.
The single remaining blocker: Hermes TUI emits no OSC terminal titles
Orca's agent-status tracking for hermes comes exclusively from OSC 0/2 terminal titles via applyTrackedPtyTitle → detectAgentStatusFromTitle (agent-title-status.ts), which requires the title to contain hermes + working|thinking|running (or a spinner glyph).
The Hermes TUI (ui-tui, Ink-based) emits no OSC 0/2 titles at all (verified by raw PTY capture: only OSC 1 bell + OSC 52 clipboard). No config option exists to enable them.
Therefore workingSequence never advances past baseline → agent_prompt_stalled always fires at the (now 120s) window → capability revoked → the worker's worker_done is rejected with dispatch_capability_invalid (--dispatch-capability token never reaches it via the normal path since the TUI composer collapses the injected preamble to a placeholder — see below).
planHermesStartupQuery (hermes-startup-query.ts) requires the launch executable token to be hermes (isHermesExecutableToken). Setting settings.agentCmdOverrides = {hermes: '<anything-not-hermes>'} silently disables the -q/--query startup injection and falls back to pasting the 91-line preamble into the Ink composer, which collapses to [[ You are working.. [91 lines] .. or: <title> ]] — the worker then receives only the placeholder (no task, no capability token). This is a footgun worth documenting or guarding.
Suggested upstream fixes (any one unblocks Hermes workers)
Hermes side: emit OSC 0/2 titles from the TUI status bar (hermes working / hermes idle transitions) — feature request for NousResearch/hermes-agent.
Orca side: fall back to PTY output activity (bytes produced since baseline) for workingSequence when agent status hooks/titles are silent — most robust for all slow/headless agents.
Orca side: when planHermesStartupQuery fails (non-hermes executable), fail loudly instead of silently degrading to composer paste.
Happy to test any of these if a patch is proposed.
Same failure on the same version, but with a bundled agent — opencode — so this is not
limited to custom agentCmdOverrides CLIs. Repro rate 6/6 on Orca 1.4.188, headless orca-serve.service, Ubuntu 24.04, opencode 1.18.23.
The agent then works normally and its first action is the heartbeat Orca handed it, which comes
back as Dispatch <id> capability is revoked. — exactly the sequence described above.
Measurements, in case they narrow it down. I tried to rule out the obvious candidates before
reporting:
Not the composer-ready signal. opencode's render-cursor-after-bracketed-paste does arrive:
on a raw PTY, ESC[?2004h at 1.5–1.7 s and ESC[?25h after it at 5.4–6.4 s — inside the
8 s render budget. Measured in a warm checkout and in a freshly created worktree with MCP servers
configured.
Not the status plugin's location.orca-opencode-status.js is materialized in ~/.config/orca/opencode-hooks/shared/plugins/ with OPENCODE_CONFIG_DIR pointing at it, and
marker plugins confirm opencode 1.18.23 loads both <config>/plugin/ and <config>/plugins/.
Not a stale terminal. Reproduced with every opencode process and terminal killed, a brand-new
worktree, and --setup skip. The effects always show action: "reused_agent_terminal" for the
agent terminal created by the agent-first worktree flow.
--timeout-ms 45000 on worker-start does not change the outcome, and orca orchestration dispatch --inject into the idle TUI fails the same way.
The prompt itself is fine: the composer holds the full preamble, and submitting it by hand makes
the worker execute the task correctly.
Two things that look load-bearing from the source:
TUI_AGENT_CONFIG.opencode.promptInjectionMode is flag-prompt, and tui-agent-startup.ts
builds <cmd> --prompt <quotedPrompt> for it — but the supervised path starts the agent through createManagedWorktree({ startupAgent })without a prompt (process argv on the host is a
bare opencode) and then pastes into the live TUI. Honouring the declared flag-prompt launch
when the terminal is created for the dispatch would skip the paste-and-verify step for these
agents entirely.
Happy to send a PR for (1) if maintainers agree with the direction; I held off because I cannot
rebuild and test the Electron app on this headless host and would rather not ship an untested
change to this path.
Workaround, for anyone else blocked: launch the agent with the task text and stop expecting worker_done:
Same shape with a bundled agent (Grok) on 1.4.190 / Windows: stall at 14s, capability revoked, task completed in the worktree, worker_done rejected. Details: #16902
Fresh live verification on the current migration stack (head 4ef37c14709, draft #21655), macOS, installed agy 1.2.7, isolated non-git folder:
The host's terminal.isRunningAgent recognized a newly launched agy pane.
Actual dispatch --inject returned injected: true with input_accepted; the task marker reached the CLI.
Actual worker-start --agent antigravity returned ready, stage input_accepted. Its Dispatch was still dispatched with zero failures 63 seconds later. It did not fail with agent_prompt_stalled after eight seconds.
A subsequent send --to @antigravity enqueued two messages, one in each test Dispatch mailbox. The first group send shortly after direct injection had returned no recipients; the later send included both the direct and supervised dispatches. That transient first lookup is not yet explained.
ELI5: current Orca can deliver the task and keep its assignment alive without pretending it observed the agent start working. This machine's agy receives the task but generation returns HTTP401 ACCESS_TOKEN_TYPE_UNSUPPORTED. The receipt correctly says turn observation is unsupported; it is not proof of successful execution, mailbox consumption, or accepted worker_done.
This was normal local startup, not a reproduced 15–60 second boot or a Windows/SSH test. Both test Dispatches were explicitly stopped and their test terminals closed afterward. Authentication and hooks were unchanged. No new production change was needed for the injection/receipt checks; #21655 changes group addressing separately.
Visual proof below is a rendered report derived from the actual CLI receipts, rather than a screenshot of the lifecycle preamble (which contains private capability material).
Follow-up verification on the migration draft stack (b109d5083be): a deliberately delayed local agy launch did not reproduce the eight-second dispatch failure.
In plain language: I made the launcher wait 20 seconds before starting the installed Antigravity 1.2.7, then asked Orca to start a supervised worker with a 90-second timeout. Orca waited and delivered the task instead of failing at eight seconds.
Evidence:
Used a temporary launcher override in an isolated macOS validation profile: sleep 20, then exec agy "$@". Restored the original override afterward.
Dispatch creation was recorded at 12:57:50 UTC; the successful CLI receipt was written at 12:58:14.914 UTC (about 25 seconds later).
Receipt: ready, input_accepted. At 12:58:38 UTC, the dispatch remained dispatched, with zero failures and no last failure.
Actual agy terminal output contains the requested task marker, then HTTP 401 ACCESS_TOKEN_TYPE_UNSUPPORTED. No successful generation or real worker_done report is claimed.
Current source also already preserves reporting capability when dispatch input fails specifically with agent_prompt_stalled (worker-start-receipt.ts). The existing database recovery tests verify that a subsequent worker report can correct that failed record, while other startup failures still revoke capability. Eight focused recovery/classification tests passed.
This is stronger than the earlier normal-startup check, but it does not cover Hermes, Ubuntu/headless/remote execution, first-run onboarding, or successful task completion. No production patch is justified by this local non-reproduction; keeping the issue open for those remaining conditions.
Retest of my 6/6 opencode repro on 1.4.206 — the Ubuntu/headless/remote gap is now covered, and it passes.
Same setup as my August report: headless orca-serve.service on Ubuntu 24.04, dispatched from a separate machine with --environment, bundled opencode (now 1.18.31), child worktrees off a real repo, trivial task ("create a file, don't commit, then report worker_done").
Dispatch input: 3/3 accepted (was 0/6 on 1.4.188).
No agent_prompt_stalled in any of the three, and turnStart: "unsupported" is exactly the honest receipt described above: Orca says it cannot observe the turn instead of failing the dispatch over it.
worker_done accepted end to end: 2/3 — the condition the previous comment explicitly did not cover.
task A dispatched_at 20:39:14Z completed_at 20:41:36Z failure_count 0
result: {"provenance":"worker_report","outcome":"succeeded", ...}
task B dispatched_at 20:39:51Z completed_at 20:44:08Z failure_count 0
Both worktrees contained the requested file, uncommitted, as asked.
The third run is not an Orca failure. Its agent's first model turn hung at the provider (no output, no tool call) and it never acted. The Dispatch stayed healthy throughout:
status: "dispatched", failure_count: 0, last_failure: null,
capability_revoked_at: null, dispatched_at 20:35:53Z — still true 13 minutes later
On 1.4.188 that same run would have been killed at ~5s with agent_prompt_stalled and its capability revoked before the agent produced anything. I stopped it with worker-stop --dispatch <id> and removed all three worktrees.
So from my side: Ubuntu 24.04 + headless orca-serve + remote dispatch + bundled opencode + successful completion is covered and working on 1.4.206. I can't speak to Hermes, Windows, or first-run onboarding.
Fixed by #16904, which made orchestration dispatch durable. The headless Ubuntu retest on 1.4.206 passed 3/3 with no agent_prompt_stalled, and a deliberately delayed 20s launch no longer fails at 8s. Thanks for the thorough repro! If you still see this on a current build, please reopen with details and we'll take another look.
Activity
fredogemilang commentedon Aug 26, 2026
Follow-up after local patch test
We patched the installed bundle (v1.4.188):
AGENT_PROMPT_EFFECT_TIMEOUT_MSfrom5e3→120e3and repacked app.asar. Results:dispatched_at 18:35:57→completed_at 18:38:06≈ 129s). The timeout itself is not the (only) problem.agent_prompt_stalled— becauseverifyAgentPromptSubmissionnever observesworkingSequenceadvancing past baseline.worker_done(rejected, exit 1, capability revoked after the stall).Suspected root cause
Hermes has the Orca-managed status-hook plugin installed (
~/.hermes/plugins/orca-status, reportson_session_start/pre_llm_call/post_llm_call/... viaORCA_AGENT_HOOK_ENDPOINT), and the runtime'sreadActivity()for hermes mapspre_llm_call/on_session_startto working-sequence advancement. In the dispatched-worker launch (hermes --tui --yolo+ injected preamble), the LLM clearly runs (UI shows synthesizing), yet no activity advance is observed — suggesting the hook events either don't fire in that launch context or their reporting to the hook endpoint is failing (e.g., env not propagated to the dispatched PTY, or the plugin is skipped in this mode).Request
Would it be possible to make the prompt-verification either (a) fall back to terminal output activity (any new bytes since baseline) when agent status hooks are unavailable/silent, or (b) expose
AGENT_PROMPT_EFFECT_TIMEOUT_MSvia env/setting? Both would make slow-booting or hook-silent agents (Hermes, agy) usable as dispatched workers. Happy to test a patch or provide the hook logs.fredogemilang commentedon Aug 26, 2026
Root cause fully mapped — final update
After extensive local testing (all with the 120s
AGENT_PROMPT_EFFECT_TIMEOUT_MSbundle patch), the complete causal chain for Hermes as a dispatched worker:What works
hermes --tui --yolo): the worker receives the full 91-line preamble, performs the task in the worktree, and attemptsworker_done. README modified correctly in every run.dcap_capability token is minted at dispatch and embedded ONLY in the preamble text (dispatch_contextsstores its sha256). With the original launch the token reaches the agent via the startup query path.The single remaining blocker: Hermes TUI emits no OSC terminal titles
applyTrackedPtyTitle→detectAgentStatusFromTitle(agent-title-status.ts), which requires the title to containhermes+working|thinking|running(or a spinner glyph).workingSequencenever advances past baseline →agent_prompt_stalledalways fires at the (now 120s) window → capability revoked → the worker'sworker_doneis rejected withdispatch_capability_invalid(--dispatch-capabilitytoken never reaches it via the normal path since the TUI composer collapses the injected preamble to a placeholder — see below).Additional finding: wrapper/override breaks hermes-query injection
planHermesStartupQuery(hermes-startup-query.ts) requires the launch executable token to behermes(isHermesExecutableToken). Settingsettings.agentCmdOverrides = {hermes: '<anything-not-hermes>'}silently disables the-q/--querystartup injection and falls back to pasting the 91-line preamble into the Ink composer, which collapses to[[ You are working.. [91 lines] .. or: <title> ]]— the worker then receives only the placeholder (no task, no capability token). This is a footgun worth documenting or guarding.Suggested upstream fixes (any one unblocks Hermes workers)
hermes working/hermes idletransitions) — feature request for NousResearch/hermes-agent.workingSequencewhen agent status hooks/titles are silent — most robust for all slow/headless agents.planHermesStartupQueryfails (non-hermesexecutable), fail loudly instead of silently degrading to composer paste.Happy to test any of these if a patch is proposed.
JSanchezFDZ commentedon Aug 27, 2026
Same failure on the same version, but with a bundled agent —
opencode— so this is notlimited to custom
agentCmdOverridesCLIs. Repro rate 6/6 on Orca 1.4.188, headlessorca-serve.service, Ubuntu 24.04, opencode 1.18.23.The agent then works normally and its first action is the heartbeat Orca handed it, which comes
back as
Dispatch <id> capability is revoked.— exactly the sequence described above.Measurements, in case they narrow it down. I tried to rule out the obvious candidates before
reporting:
render-cursor-after-bracketed-pastedoes arrive:on a raw PTY,
ESC[?2004hat 1.5–1.7 s andESC[?25hafter it at 5.4–6.4 s — inside the8 s render budget. Measured in a warm checkout and in a freshly created worktree with MCP servers
configured.
orca-opencode-status.jsis materialized in~/.config/orca/opencode-hooks/shared/plugins/withOPENCODE_CONFIG_DIRpointing at it, andmarker plugins confirm opencode 1.18.23 loads both
<config>/plugin/and<config>/plugins/.worktree, and
--setup skip. The effects always showaction: "reused_agent_terminal"for theagent terminal created by the agent-first worktree flow.
--timeout-ms 45000onworker-startdoes not change the outcome, andorca orchestration dispatch --injectinto the idle TUI fails the same way.the worker execute the task correctly.
Two things that look load-bearing from the source:
agent-prompt-submission-verification.tsaccepts three proofs.workingSequencecomes from thesynthetic-title route, which the comment in that file says does not survive headless serve
([Bug]: agent_prompt_stalled for codex/kimi workers — fixed 5s confirmation window vs ~20s first hook-event latency (root-cause evidence) #16095);
observedDeliveryEvidencerequiresbaseline.status === 'working', false for an idleagent taking its first task; so only the hook edge is left — and
opencodeis not inHOOK_OBSERVED_TURN_START_AGENTS, so it gets 5 s instead of the 15 s that codex/kimi got from[Bug]: agent_prompt_stalled for codex/kimi workers — fixed 5s confirmation window vs ~20s first hook-event latency (root-cause evidence) #16095. A reasoning model behind a remote API easily exceeds that: in my runs the first tool call
landed at 12.9 s.
opencodeandmimo-code(same profile,synthesizeTerminalTitle: false)look like they belong in that set.
TUI_AGENT_CONFIG.opencode.promptInjectionModeisflag-prompt, andtui-agent-startup.tsbuilds
<cmd> --prompt <quotedPrompt>for it — but the supervised path starts the agent throughcreateManagedWorktree({ startupAgent })without a prompt (process argv on the host is abare
opencode) and then pastes into the live TUI. Honouring the declaredflag-promptlaunchwhen the terminal is created for the dispatch would skip the paste-and-verify step for these
agents entirely.
Happy to send a PR for (1) if maintainers agree with the direction; I held off because I cannot
rebuild and test the Electron app on this headless host and would rather not ship an untested
change to this path.
Workaround, for anyone else blocked: launch the agent with the task text and stop expecting
worker_done:orca terminal create --worktree path:/path/to/worktree \ --command "opencode --model <provider>/<model> --auto --prompt '<task text>'"then follow the worker with
orca terminal read/ git instead of the dispatch state.nakedsleepwalker commentedon Aug 28, 2026
Same shape with a bundled agent (Grok) on 1.4.190 / Windows: stall at 14s, capability revoked, task completed in the worktree,
worker_donerejected. Details: #16902feat(orchestration): make multi-agent workflows durable (#16904)
nwparker commentedon Sep 19, 2026
Fresh live verification on the current migration stack (head
4ef37c14709, draft #21655), macOS, installed agy 1.2.7, isolated non-git folder:terminal.isRunningAgentrecognized a newly launched agy pane.dispatch --injectreturnedinjected: truewithinput_accepted; the task marker reached the CLI.worker-start --agent antigravityreturnedready, stageinput_accepted. Its Dispatch was stilldispatchedwith zero failures 63 seconds later. It did not fail withagent_prompt_stalledafter eight seconds.send --to @antigravityenqueued two messages, one in each test Dispatch mailbox. The first group send shortly after direct injection had returned no recipients; the later send included both the direct and supervised dispatches. That transient first lookup is not yet explained.ELI5: current Orca can deliver the task and keep its assignment alive without pretending it observed the agent start working. This machine's agy receives the task but generation returns HTTP401
ACCESS_TOKEN_TYPE_UNSUPPORTED. The receipt correctly says turn observation is unsupported; it is not proof of successful execution, mailbox consumption, or acceptedworker_done.This was normal local startup, not a reproduced 15–60 second boot or a Windows/SSH test. Both test Dispatches were explicitly stopped and their test terminals closed afterward. Authentication and hooks were unchanged. No new production change was needed for the injection/receipt checks; #21655 changes group addressing separately.
Visual proof below is a rendered report derived from the actual CLI receipts, rather than a screenshot of the lifecycle preamble (which contains private capability material).
nwparker commentedon Sep 19, 2026
Follow-up verification on the migration draft stack (
b109d5083be): a deliberately delayed local agy launch did not reproduce the eight-second dispatch failure.In plain language: I made the launcher wait 20 seconds before starting the installed Antigravity 1.2.7, then asked Orca to start a supervised worker with a 90-second timeout. Orca waited and delivered the task instead of failing at eight seconds.
Evidence:
sleep 20, thenexec agy "$@". Restored the original override afterward.ready,input_accepted. At 12:58:38 UTC, the dispatch remaineddispatched, with zero failures and no last failure.ACCESS_TOKEN_TYPE_UNSUPPORTED. No successful generation or realworker_donereport is claimed.Current source also already preserves reporting capability when dispatch input fails specifically with
agent_prompt_stalled(worker-start-receipt.ts). The existing database recovery tests verify that a subsequent worker report can correct that failed record, while other startup failures still revoke capability. Eight focused recovery/classification tests passed.This is stronger than the earlier normal-startup check, but it does not cover Hermes, Ubuntu/headless/remote execution, first-run onboarding, or successful task completion. No production patch is justified by this local non-reproduction; keeping the issue open for those remaining conditions.
JSanchezFDZ commentedon Sep 21, 2026
Retest of my 6/6
opencoderepro on 1.4.206 — the Ubuntu/headless/remote gap is now covered, and it passes.Same setup as my August report: headless
orca-serve.serviceon Ubuntu 24.04, dispatched from a separate machine with--environment, bundledopencode(now 1.18.31), child worktrees off a real repo, trivial task ("create a file, don't commit, then reportworker_done").Dispatch input: 3/3 accepted (was 0/6 on 1.4.188).
No
agent_prompt_stalledin any of the three, andturnStart: "unsupported"is exactly the honest receipt described above: Orca says it cannot observe the turn instead of failing the dispatch over it.worker_doneaccepted end to end: 2/3 — the condition the previous comment explicitly did not cover.Both worktrees contained the requested file, uncommitted, as asked.
The third run is not an Orca failure. Its agent's first model turn hung at the provider (no output, no tool call) and it never acted. The Dispatch stayed healthy throughout:
On 1.4.188 that same run would have been killed at ~5s with
agent_prompt_stalledand its capability revoked before the agent produced anything. I stopped it withworker-stop --dispatch <id>and removed all three worktrees.So from my side: Ubuntu 24.04 + headless
orca-serve+ remote dispatch + bundledopencode+ successful completion is covered and working on 1.4.206. I can't speak to Hermes, Windows, or first-run onboarding.OrcaWin commentedon Oct 9, 2026
Fixed by #16904, which made orchestration dispatch durable. The headless Ubuntu retest on 1.4.206 passed 3/3 with no agent_prompt_stalled, and a deliberately delayed 20s launch no longer fails at 8s. Thanks for the thorough repro! If you still see this on a current build, please reopen with details and we'll take another look.
feat(orchestration): make multi-agent workflows durable (stablyai#16904)