Repository navigation
fix(runtime): reopen the quiet-foreground tui-idle lane for agents with no other rest signal - #23598
Conversation
…th no other rest signal A tui-idle wait could never settle on a pane running amp, goose, crush, kimi, qwen-code, rovo, auggie and other agents whose titles Orca cannot classify: the quiet-foreground lane was closed for every launched agent, and it was the only lane those agents could reach, so worker start failed at agent_readiness after 60s. Model each agent's rest signal, derived from the tables that already encode it (synthetic ready titles, the title classifier, the DSH hook and Muse ready screen lanes). The lane stays closed where a stronger signal will arrive and reopens for agents with none. On a reopened lane, silence counts only after the TUI has painted: an agent that has painted nothing is still booting. Linear: STA-7440
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (5)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review. 📝 WalkthroughWalkthroughThe change adds agent rest-signal classifications and command-paint tracking for PTY output. OSC 133 command-start scanning reports the marker’s position within the current chunk. Idle polling uses quiet-foreground lanes, command-paint checks, and quiescence timing when it assesses PTY and leaf readiness. Tests cover agent classifications, paint detection, and quiet-foreground polling. Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to The reported typecheck blocker is resolved, and no verified merge-blocking risk remains. Security Architecture ReviewSecurity architecture risk: 🟡 Moderate · up to More agent sessions can now become ready when their terminal goes quiet. If terminal output is lost, a wait can finish before there is evidence that the agent displayed its screen. The identified exposure is limited to affected terminal sessions; no wider service or privilege change is established. Retained concerns
Security review detailsSecurity Blast Radius
Security Findings and Attack Paths
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Important
The after-paint guard does not actually verify the agent painted — lastOutputAt is already set by the shell prompt and launch-command echo, so the lane can settle during agent boot. Details inline.
Reviewed changes
- Rest-signal derivation — new
src/shared/tui-agent-rest-signal.tsclassifies eachTuiAgentashook-done/synthetic-title/title/ready-body/none, derived from the existing title tables rather than a second hand-kept table. - Reopened lane —
src/main/runtime/tui-idle-evidence.tschangesquietForegroundfrom a boolean toQuietForegroundLane('closed' | 'after-paint' | 'open'); agents with no other rest signal get'after-paint', unknown panes keep'open'. - Paint gate —
src/main/runtime/runtime-terminal-idle-polls.tsruns the foreground poll for lanes other than'closed'and requires a non-nulllastOutputAton'after-paint'. - Tests — a full-table pin for the derived signals, per-agent lane-agreement checks, plus an amp settle test and a claude non-settle test.
ℹ️ Some 'none' agents may already paint a classifying title
qwen-code (a gemini-cli fork that uses Gemini's --approval-mode flag) and prime-agent (which embeds Pi's TUI) are classified 'none'. If either actually emits a classifying glyph/name title, reopening the lane is a direction-reversed error: main correctly closed it, and 'after-paint' would now allow a premature settle for an agent that already had a signal.
Technical details
# Unverified `'none'` classifications
## Affected sites
- src/shared/tui-agent-rest-signal.ts:33 — the classification bottoms out in `detectAgentStatusFromTitle(expectedProcess)`, which is true only if the process name itself is a recognized agent token.
- src/shared/tui-agent-config.ts:281 — `qwen-code` uses Gemini-shaped CLI flags; if it inherits the fork's `✦`/`◇` OSC glyphs it would classify.
- src/shared/tui-agent-config.ts:177 — `prime-agent` embeds Pi's TUI; Pi has a native `π …` title writer.
## Required outcome
- Confirm from a captured transcript (per docs/reference/agent-pty-transcript-capture.md) whether either agent emits a classifying title. If so, it should not be `'none'`.
## Open questions for the human
- Is there a recorded `qwen`/`prime-agent` transcript that shows (or rules out) an OSC title? This is the same evidence bar the PR applied to the title classifier elsewhere.ℹ️ Nitpicks
- The new per-agent agreement test returns early for every non-
nonesignal (tui-idle-evidence.test.ts:201), so nothing pins that a'title'/'synthetic-title'agent actually has the lane it claims — which is how theantigravitylabel slipped through. - The claude non-settle case in
runtime-terminal-idle-polls.test.tswas already'closed'on main, so it guards a regression but does not distinguish the new behavior; the amp case is the one that does.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
| return 'synthetic-title' | ||
| } | ||
| // Why the process name: the title tables match an agent by the name it runs as. | ||
| if (detectAgentStatusFromTitle(TUI_AGENT_CONFIG[agent].expectedProcess) !== null) { |
There was a problem hiding this comment.
antigravity derives to 'title' here because its expectedProcess is agy, but agy emits no OSC title at all (see docs/reference/antigravity-readiness-evidence.md); its real readiness lane is the ready-body screen, the same category as muse. The behavior is unaffected — both non-none values map to 'closed' and the body lane still settles — but the title doc line is inaccurate and no test covers this direction.
Technical details
# `antigravity` mislabeled as a title-signal agent
## Affected sites
- src/shared/tui-agent-rest-signal.ts:33 — `detectAgentStatusFromTitle('agy')` matches `AGY_AGENT_NAME_RE` and falls through to `'idle'`, so the proxy reports a title signal the agent never emits.
- docs/reference/antigravity-readiness-evidence.md:231,235 — agy sets no OSC title; the ready screen is its only signal.
- src/main/runtime/antigravity-terminal-readiness.ts — the body lane that actually settles agy waits.
## Required outcome
- Classify `antigravity` as `'ready-body'` (identity table) rather than deriving `'title'` from the process name, so the table matches reality.
## Suggested approach
- Move `antigravity` into `IDENTITY_REST_SIGNALS` alongside `muse`, or broaden the derivation to consult the known ready-body registry rather than the process-name proxy alone.… on the tui-idle foreground lane The after-paint lane accepted any output, and the shell's prompt and echoed launch command always land before the agent starts, so a silently booting agent could still settle and lose its first prompt. The runtime now reads the shell integration's command-start marker and requires visible output after it; panes whose shell emits no marker keep the any-output rule. Also skip the foreground-process read while the pane cannot settle, and register the new title-classifier call site in the pane agent identity inventory.
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 1949c44d-28e6-44e9-bed3-b26c43684dbc
📒 Files selected for processing (14)
src/main/runtime/orca-runtime-on-pty-data.tssrc/main/runtime/orca-runtime-runtime-id.tssrc/main/runtime/runtime-terminal-idle-polls.test.tssrc/main/runtime/runtime-terminal-idle-polls.tssrc/main/runtime/runtime-terminal-state-records.tssrc/main/runtime/terminal-command-paint.test.tssrc/main/runtime/terminal-command-paint.tssrc/main/runtime/terminal-wait-name-only-idle.test.tssrc/main/runtime/tui-idle-command-paint.test.tssrc/main/runtime/tui-idle-evidence.test.tssrc/main/runtime/tui-idle-evidence.tssrc/shared/pane-agent-identity-inventory.test.tssrc/shared/tui-agent-rest-signal.test.tssrc/shared/tui-agent-rest-signal.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.
| const EXPECTED_REST_SIGNALS: Record<TuiAgent, TuiAgentRestSignal> = { | ||
| dsh: 'hook-done', | ||
| codex: 'synthetic-title', | ||
| cursor: 'synthetic-title', | ||
| pi: 'synthetic-title', | ||
| omp: 'synthetic-title', | ||
| droid: 'synthetic-title', | ||
| hermes: 'synthetic-title', | ||
| devin: 'synthetic-title', | ||
| zcode: 'synthetic-title', | ||
| claude: 'title', | ||
| 'claude-agent-teams': 'title', | ||
| openclaude: 'title', | ||
| opencode: 'title', | ||
| opencode2: 'title', | ||
| 'mimo-code': 'title', | ||
| gemini: 'title', | ||
| antigravity: 'title', | ||
| aider: 'title', | ||
| openclaw: 'title', | ||
| copilot: 'title', | ||
| grok: 'title', | ||
| muse: 'ready-body', | ||
| autohand: 'none', | ||
| ante: 'none', | ||
| trae: 'none', | ||
| 'prime-agent': 'none', | ||
| goose: 'none', | ||
| amp: 'none', | ||
| kilo: 'none', | ||
| kiro: 'none', | ||
| crush: 'none', | ||
| aug: 'none', | ||
| cline: 'none', | ||
| codebuff: 'none', | ||
| 'command-code': 'none', | ||
| continue: 'none', | ||
| kimi: 'none', | ||
| 'mistral-vibe': 'none', | ||
| 'qwen-code': 'none', | ||
| rovo: 'none' | ||
| } |
There was a problem hiding this comment.
🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win
Add the missing freebuff entry. Typecheck fails without it.
EXPECTED_REST_SIGNALS has the type Record<TuiAgent, TuiAgentRestSignal>. The CI failure is TS2741: the freebuff property is missing. pnpm run typecheck and build:cli both fail. Add freebuff with the signal that getTuiAgentRestSignal('freebuff') derives. The value is probably 'none' because freebuff is related to codebuff, but confirm it against the derived value.
Proposed fix
codebuff: 'none',
+ freebuff: 'none',
'command-code': 'none',📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| const EXPECTED_REST_SIGNALS: Record<TuiAgent, TuiAgentRestSignal> = { | |
| dsh: 'hook-done', | |
| codex: 'synthetic-title', | |
| cursor: 'synthetic-title', | |
| pi: 'synthetic-title', | |
| omp: 'synthetic-title', | |
| droid: 'synthetic-title', | |
| hermes: 'synthetic-title', | |
| devin: 'synthetic-title', | |
| zcode: 'synthetic-title', | |
| claude: 'title', | |
| 'claude-agent-teams': 'title', | |
| openclaude: 'title', | |
| opencode: 'title', | |
| opencode2: 'title', | |
| 'mimo-code': 'title', | |
| gemini: 'title', | |
| antigravity: 'title', | |
| aider: 'title', | |
| openclaw: 'title', | |
| copilot: 'title', | |
| grok: 'title', | |
| muse: 'ready-body', | |
| autohand: 'none', | |
| ante: 'none', | |
| trae: 'none', | |
| 'prime-agent': 'none', | |
| goose: 'none', | |
| amp: 'none', | |
| kilo: 'none', | |
| kiro: 'none', | |
| crush: 'none', | |
| aug: 'none', | |
| cline: 'none', | |
| codebuff: 'none', | |
| 'command-code': 'none', | |
| continue: 'none', | |
| kimi: 'none', | |
| 'mistral-vibe': 'none', | |
| 'qwen-code': 'none', | |
| rovo: 'none' | |
| } | |
| const EXPECTED_REST_SIGNALS: Record<TuiAgent, TuiAgentRestSignal> = { | |
| dsh: 'hook-done', | |
| codex: 'synthetic-title', | |
| cursor: 'synthetic-title', | |
| pi: 'synthetic-title', | |
| omp: 'synthetic-title', | |
| droid: 'synthetic-title', | |
| hermes: 'synthetic-title', | |
| devin: 'synthetic-title', | |
| zcode: 'synthetic-title', | |
| claude: 'title', | |
| 'claude-agent-teams': 'title', | |
| openclaude: 'title', | |
| opencode: 'title', | |
| opencode2: 'title', | |
| 'mimo-code': 'title', | |
| gemini: 'title', | |
| antigravity: 'title', | |
| aider: 'title', | |
| openclaw: 'title', | |
| copilot: 'title', | |
| grok: 'title', | |
| muse: 'ready-body', | |
| autohand: 'none', | |
| ante: 'none', | |
| trae: 'none', | |
| 'prime-agent': 'none', | |
| goose: 'none', | |
| amp: 'none', | |
| kilo: 'none', | |
| kiro: 'none', | |
| crush: 'none', | |
| aug: 'none', | |
| cline: 'none', | |
| codebuff: 'none', | |
| freebuff: 'none', | |
| 'command-code': 'none', | |
| continue: 'none', | |
| kimi: 'none', | |
| 'mistral-vibe': 'none', | |
| 'qwen-code': 'none', | |
| rovo: 'none' | |
| } |
🧰 Tools
🪛 GitHub Actions: PR 23598 | source 4db989481014da0edc67fb2bc318d8896340e3d0 | workflow 4db989481014da0edc67fb2bc318d8896340e3d0 | unit full / static analysis
[error] 8-8: TypeScript compilation failed during pnpm run smoke:orcad-terminal (via pnpm run build:cli): the Record<TuiAgent, TuiAgentRestSignal> value is missing the required freebuff property (TS2741).
🪛 GitHub Actions: PR 23598 | source 4db989481014da0edc67fb2bc318d8896340e3d0 | workflow 4db989481014da0edc67fb2bc318d8896340e3d0 | unit full / typecheck
[error] 8-8: pnpm run typecheck failed: TypeScript error TS2741 — the Record<TuiAgent, TuiAgentRestSignal> value is missing the required 'freebuff' property.
Source: Pipeline failures
There was a problem hiding this comment.
ℹ️ No critical issues — one hardening note inline.
Reviewed changes
Reviewed the delta since the prior pullfrog review (048fcd5b25 → f796e537b5), which adds the agent-paint gate the earlier review asked for:
- Command-paint tracking — new
src/main/runtime/terminal-command-paint.tsrecords the shell's OSC 133;C command-start marker per PTY and reportscommandPaintedAtonly once visible output follows it;observeTerminalCommandPaintruns fromonPtyData. - Gate wired into the poll —
isQuietForQuiescencenow returns false for theafter-paintlane untilhasCommandPaintedis true, and the runtime wireshasCommandPaintedto the PTY's paint record; the foreground read is skipped while the pane cannot settle. - Coverage — new
terminal-command-paint.test.ts(marker rules) andtui-idle-command-paint.test.ts(a full runtime amp pane that stays unsettled through a silent boot after the echoed command, then settles on the paint), plus the poll-level amp settle/read-count case.
Note: I resolved the earlier after-paint thread — the new gate addresses it. The antigravity thread remains open and is unchanged by this delta.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
…-tui-idle-rest-signal
…arker scan on chunks without one Main added the Freebuff agent after this branch point, so the full per-agent rest-signal table no longer matched on the merge ref. Freebuff derives `none`: its screen reports a first-party `done`, which tui-idle trusts only for DSH, so the quiet-foreground lane is its only one. The command-start scan ran a backward search over every PTY chunk; a forward check first cuts that to the cost of a plain substring test on chunks with no marker.
…-tui-idle-rest-signal
Main added Qoder with its own readiness branch returning a boolean quiet-foreground flag; map it to the lane type and classify Qoder by its ready screen so the full rest-signal table and lane-agreement check stay exhaustive. Say what `none` actually means: no stronger lane tui-idle trusts, not no hooks at all.
The command-paint tracker had its own split-unsafe 133;C parser. Reuse the chunk-boundary-safe scanner, which now reports where in the chunk the marker ended, so a marker split across reads is still found. Correct the unmarked-launch list: bash and zsh mark typed launches after the echo.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Reviewed the delta since the prior pullfrog review (f796e537b5 → e75db54111):
- Split-marker paint tracking —
terminal-command-paint.tsreplaces its hand-rolledlastIndexOfscanner with aTerminalCommandPaintclass that delegates to the sharedcreateOsc133CommandFinishedScanner, whose carry resolves a\x1b]133;Cmarker split across PTY reads. This closes the prior hardening thread: a split marker now still arms the gate, and the paint slice is taken fromendInChunkin the current chunk's coordinates. - Scanner reports where the command's output begins —
createOsc133CommandFinishedScanner'sonCommandStartednow receivesendInChunk(index just past the sequence). Existing renderer/main callers pass a zero-arg callback and are unaffected; verified thecombinedStartInChunkarithmetic stays positive even when the terminator spans the carry/data boundary. - Qoder classified
ready-body— added toIDENTITY_REST_SIGNALS, so its quiet-foreground lane stays closed behind the composer screen (isQoderComposerReady), matching theevaluateTuiIdleqoder branch on main. The per-agent agreement test assertsmuseBody || screenReadand is satisfied for qoder viascreenRead. - Lane type cleanup —
quietForeground: falsebecame'closed'at the non-lane resolver sites, and the title/body tier checks were reordered (same verdict, cheaper order). - Tests — split-marker rule, qoder agreement, and the amp poll read-count assertion.
One pre-existing thread remains open and unchanged by this delta: antigravity still derives 'title' from expectedProcess === 'agy' even though agy emits no OSC title, with no behavioral impact (both non-none values map to 'closed'). Approval is withheld only for that reason; nothing in the new commits needs further work.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
A dropped chunk can cut a command-start marker in half, and the scanner's carry then completes it on unrelated output after the gap, leaving the pane waiting for a paint that already happened. Reset it with the other cross-chunk carries.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Reviewed the delta since the prior pullfrog review (e75db54111 → fc0576d0fa):
- Clear the paint record on a discontinuity —
notePtyDataGapnow dropspty.commandPaintalongsidetailPendingAnsi, andresetTrackedTerminalStateForProviderGenerationdrops it when a same-id respawn reuses the terminal. A half-written\x1b]133;Ccarry can no longer be completed by unrelated output after a gap and leave the pane waiting for a paint the agent already made; the field reading as painted is the existing no-marker fallback, so this is the safe direction. - Regression test —
tui-idle-command-paint.test.tspins that an amp pane whose command-start marker is cut off by dropped output still settles. I ablated it by removing thenotePtyDataGapreset: the case times out at 30s, so it genuinely fails without the fix. - Record comment — documents that
commandPaintis absent again after a gap or a new process.
The antigravity thread from the first review remains open and is unchanged by this delta, so approval stays withheld only for that reason.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Reviewed the delta since the prior pullfrog review (fc0576d0fa → 0c5d01ad5f):
- Renderer command-start callback no longer receives the chunk offset —
terminal-command-lifecycle.tswrapsoptions.onCommandStartedin a zero-arg closure before handing it to the shared OSC 133 scanner.TerminalCommandLifecycleOptions.onCommandStartedis declared() => void, but a caller can supply a callback with an optional parameter (pane-foreground-agent-tracker.ts'sonCommandStarted(expectedAgent?)), so the scanner's newendInChunknumber could have landed in that optional param. This is the only caller that forwardedonCommandStarted; the other scanner callers pass none, andterminal-command-paint.tssupplies its own(endInChunk)handler. Renderer lifecycle and OSC 133 carry tests pass (13).
The antigravity thread from the first review remains open and is unchanged by this delta, so approval stays withheld only for that reason.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏




What this fixes (scope)
The bug: since #20155 (merged 2026-09-13), terminal agents that give Orca no readiness signal can never be detected as ready, so anything that waits for them to be ready times out:
orca worker start --agent <agent>fails after 60 s with "Agent did not become ready", and so do orchestration dispatch, launch-with-prompt, automations andorca terminal wait --for tui-idleon those panes.Who hits it: only terminal panes running one of these agents: amp, goose, crush, kimi, qwen-code, rovo, aug, cline, kiro, kilo, codebuff, freebuff, continue, trae, ante, autohand, mistral-vibe, command-code, prime-agent. Local, SSH and WSL panes alike.
Not affected: Claude, Codex, Gemini, Grok, OpenCode, Cursor, DSH, Muse, Qoder and every other agent with an existing readiness signal (they keep exactly today's behaviour, pinned by tests); structured (native) chat; plain shells with no agent.
ELI5
Before Orca types a task into an agent's terminal, it waits for the agent to look ready. For some agents (Amp, Goose, Crush, Kimi, Qwen Code, Rovo Dev, Auggie and about a dozen others), Orca has no way to read "I'm ready" from the agent, so the only clue it has is "this program has gone quiet". #20155 (merged 2026-09-13) switched that clue off for every agent Orca launches, so for these agents the wait could never succeed. This turns it back on for exactly the agents that have nothing better, and makes it wait until the agent itself has drawn something on screen first. The shell's own prompt and the typed launch command do not count.
What Changed
Before:
orca worker start --agent amp(and the same for goose, crush, kimi, qwen-code, rovo, aug, cline, kiro, kilo, codebuff, freebuff, continue, trae, ante, autohand, mistral-vibe, command-code, prime-agent) waited the full 60 seconds and then failed with "Agent did not become ready". Any other readiness wait on those panes (orchestration dispatch, launch-with-prompt, automations,orca terminal wait --for tui-idle) ran to its timeout the same way.After: those panes become ready about 3 seconds after the agent finishes drawing its screen, and not before the agent has drawn anything. Agents that already had a readiness signal (Claude, Codex, Gemini, Grok, OpenCode, DSH, Muse and the rest) behave exactly as before.
Mechanism, in four parts:
src/shared/tui-agent-rest-signal.tsrecords how each agent says it is at rest: its own hook reporting the turn ended (DSH), an Orca-written " ready" title (Codex, Cursor, Pi, ...), a title the status classifier reads (Claude, Gemini, Grok, ...), a recognised ready screen (Muse, Qoder), or no stronger signal that the readiness wait trusts. Amp, Kimi and Command Code have hooks and Freebuff reports a screen-derived "done", but the wait takes those only as "still working" vetoes (it trusts a "done" only from DSH), so they land in "nothing" too. It is derived from the tables that already encode this, not hand-written per agent, so it cannot drift from them. An agent with no existing evidence gets "nothing", which is the safe default because of part 3.tui-idle-evidence.ts, the "quiet program in the foreground" readiness lane used to be closed whenever Orca knew which agent was running. It is now closed only for agents with a stronger signal still to come, and reopened for agents with none. It still closes the moment any title classifies, and a hook saying the agent is working still vetoes it.terminal-command-paint.tsrecords that marker per terminal, using the existing chunk-boundary-safe OSC 133 scanner (terminal-osc133-command-finished.ts, which now also reports where in the chunk the marker ended), andruntime-terminal-idle-polls.tsaccepts silence only after visible output that followed it. Orca types these agents' launch command into bash and zsh (local, terminal daemon and SSH relay alike), and both print the marker after the echo, so those panes get the full protection (checked on bash 3.2). A launch that gets no marker falls back to "any output": zsh on an SSH host (the remote zsh wrapper prints no command markers), older fish, shells Orca could not wrap (sh, dash, nu, or bash/zsh when the wrapper files are unusable), and Windows, where cmd.exe and PowerShell usually receive the command as a launch argument, so no prompt or echo precedes the agent there. Panes where Orca knows no agent keep their existing behaviour, because that rule exists for panes whose output never reaches Orca.Why
Regression source: #20155 ("fix(runtime): stop a name-only agent title from satisfying tui-idle", merged 2026-09-13). It added
quietForegroundProcessProvesTuiIdle(agent)returning!agent, which closed the quiet-foreground lane for every agent Orca launches, including the ones that have no other readiness signal. Since that merge, those agents can never pass a readiness wait.#20155 closed this lane to stop Orca typing a prompt into an agent that was still starting up and losing it. That was right for agents that will announce readiness some other way, but it used "Orca knows which agent this is" as the test, when the real question is "will this agent ever send a better signal". For agents that never will, that lane was the only one they had.
Alternatives considered:
Known limits, stated plainly: for an agent with no readiness signal, silence is the only evidence there is. If such an agent draws something and then pauses for more than 3 seconds while still starting up, the wait can still settle early, and where the launch is not marked (zsh on SSH hosts, older fish, shells Orca could not wrap, a long command typed into cmd.exe) the shell's own echo still counts as a paint. The same holds for later waits on these panes (for example an automation waiting for a turn to finish): a pause of more than 3 seconds with nothing drawn reads as done. That is how these agents behaved before #20155. Only a real readiness signal from the agent removes it. An agent pane adopted after an Orca restart that has printed nothing since cannot settle on this lane; that was already true on main.
No new data is persisted and nothing new is sent between app and host. The capability is a fixed table in the running app, the command-started record lives only in memory beside the terminal's other output state, and the wait runs on the machine that owns the terminal. For SSH panes where the foreground program cannot be read, this lane is unavailable, as it was before.
Linked Issue
Linear: STA-7440
Regression introduced by #20155.
Visual Proof
N/A: no UI change. This only changes when a readiness wait on an agent terminal succeeds; the visible effect is a worker start that completes instead of failing after 60 seconds.
Testing
tui-agent-rest-signal.test.ts: every launchable agent has a rest signal, pinned in a full table so adding an agent will not compile until someone classifies it.tui-idle-evidence.test.ts: amp, goose, crush, kimi, qwen-code, rovo and aug get the reopened lane; claude, codex, grok and dsh keep it closed; any classified title closes it. A per-agent check confirms that every agent marked as having no signal is refused by every stronger lane (DSH hook, Muse screen, Codex screen, synthetic title, title classifier).runtime-terminal-idle-polls.test.ts: an amp pane does not settle while it has painted nothing (five poll cycles) and makes no foreground-process read meanwhile, does not settle within the quiet window after its first output, then settles. A Claude pane never settles on this lane.tui-idle-command-paint.test.ts(through the real runtime): an amp pane whose shell has already printed its prompt, the echoed command and the command-started marker does not settle through 10 seconds of silent boot, then settles after the agent draws.terminal-command-paint.test.tscovers the marker rules: a title set after the marker is not a paint, a paint in the same chunk as the marker is, and the next command starts over.Ablations: with the product code reverted to main, the amp settle test fails (the wait never settles). With only the "must have painted" rule removed, the same test fails because the pane settles before painting anything. With the command-started check removed from the poll, or the marker no longer recorded from terminal output, the runtime test fails because the pane settles during the silent boot. With the foreground read no longer skipped, the read-count assertion fails.
vitestoversrc/main/runtimeand the related shared suites: 917 files, 9618 tests passed on the first commit; after the review fix, every tui-idle, terminal-wait and output-handling suite, the aggregate runtime suite (1314 tests) and all ofsrc/sharedpass. The changed-code quality gate passes. Typecheck passed on the first commit and is re-run on the latest one.Second review: merged current main, which added Freebuff; the full rest-signal table now includes it (
none, because tui-idle trusts a first-partydoneonly from DSH). The command-start scan gained a forward substring check before its backward search (measured 6x to 25x cheaper per 64 KB chunk without a marker); the third review replaced that scan with the shared scanner.vitestoversrc/main/runtimeandsrc/sharedon the merged tree: 1760 files, 19254 tests passed.Third review: merged current main, which added Qoder and a Qoder branch in the readiness evaluation; Qoder is classified by its ready screen (its composer), so its quiet-program lane stays closed as main intends. The command-paint tracker now reuses the shared OSC 133 scanner instead of its own parser, so a marker split across two output chunks is still found (new test; with the scanner's carry dropped the test fails, and with the in-chunk offset ignored the prompt and echo count as paint and four tests fail, including the runtime silent-boot test).
vitestoversrc/main/runtime,src/sharedand the renderer OSC 133 callers on the merged tree: 1764 files, 19321 tests passed; the changed-code quality gate passes.Fourth review: the command-paint record is now dropped, with the other cross-chunk parse state, when the terminal host reports dropped output or a new process reuses the terminal id. Otherwise half a command-started marker from before the gap (fish's marker carries the command line) could be completed by unrelated output after it, and the pane would wait for a paint it had already made (new runtime test; it times out without the reset).
vitestoversrc/main/runtimeplus the rest-signal and OSC 133 suites: 918 files, 9358 tests passed; the changed-code quality gate passes.Live QA on a second Mac, in an isolated dev build with fake
amp,gooseandclaudeexecutables standing in for the real CLIs (real ones update themselves and touch real config), at the second commit of this branch (before the review merges and the shared-scanner change): on main,orca orchestration worker-start --agent ampfailed at its timeout with the task never delivered. On this branch amp and goose became ready about 3.9 seconds after they first drew, including when amp stayed silent for 5, 10 or 20 seconds after launch, and nothing was typed before it drew. A Claude pane with its title was ready as fast as before, a Claude pane without a title still timed out as before, and a plain non-agent program settled as before.I manually tested these changes locally
Automated tests added/updated, or explained why not below
Review
Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
Security: no change. Cross-platform: platform-neutral; the foreground-process read already exists on every platform. SSH: unchanged; the lane needs a foreground read, which remote panes may not provide. Mobile and mixed versions: no wire or stored change. Performance: one table lookup per poll tick; one marker search per terminal output chunk; fewer foreground-process reads than before, since panes that cannot settle yet skip them.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)