Repository navigation
Conversation
`terminal wait --for tui-idle` after `terminal create --command "omp <flags>"` satisfied in ~2s on a blank screen with agentIdentity null, and a prompt sent at that point was silently dropped: the bare-command matcher only recognizes exact launch commands, so any flags left the pane's agent unknown and the wait fell into the agent-null generic lane. Seed each runtime-owned spawn with its launch command line and resolve the pane agent from its first token for the wait ranking and the published identity; retiring the launch authority on exit also clears the seed so a pane returning to a shell prompt is not mistaken for the agent. Managed launches (no flags) are unchanged, no readiness rule is touched, and adopted or restored panes (no seeded command) keep their existing behavior. Fixes stablyai#25264 Generated-by: GLM-5.3-Flash (ZCode)
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. 🧰 Additional context used📚 Code guidelines (1)No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (11)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughRuntime-owned PTY records now store the requested launch command. When Priority: ➖ Normal Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to Flagged agent launches can receive an identity before foreground detection without displacing a later detected foreground agent. No merge-blocking issue was established; normal validation remains appropriate. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The change affects how terminals are identified and when they are considered ready. Existing access controls remain separate, but startup and reconnection edge cases are not fully established. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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.
✅ No new issues found.
Reviewed changes
- Seed
launchCommandLineon runtime-owned spawns —orca-runtime-create-terminal.ts(only when not adopting a stable pane) andorca-runtime-split-pty-backed-terminal.tsrecord the requested command;record-pty-worktree.tsinitializes it tonullso adopted/restored panes keep today's behavior. - Resolve the pane agent from that command —
resolveLaunchCommandPaneAgentreusesrecognizeAgentProcessFromCommandLine(headless one-shot filter intact) and gates onisTuiAgent, then feedsgetPaneAgentForTuiIdleand the publishedagentIdentity(build-pty-terminal-summary.ts,write-orchestration-pointer-pty.ts,runtime-id.ts) as a fallback behindlaunchAgent/foregroundAgent. - Retire the seeded command with launch authority —
retirePtyAgentLaunchAuthoritynow also keys on!pty.launchCommandLineand clears it, so a pane back at a shell prompt is not mistaken for the agent. - Tests — new
runtime-agent-launch-resolution.test.ts(5 cases: first-token recognition, headless filter, non-TuiAgent and non-agent commands) plus two runtime cases proving wait ranking/published identity seeompforomp --model xand that the identity retires on133;D.
Verified the resolver unit tests pass locally (5/5), and traced the wait path: getPaneAgent flows into tui-idle-evidence-source.ts, which hands agent to isKnownReadyPromptBody and the agent state rules — so a flagged omp launch now takes the OMP lane instead of the agent-null quiescence fallback, which is the reported failure. The retirement-guard widening is broader than "names an agent" (any --command pane retires on its first 133;D), but 133;D is the shell wrapper reporting the foreground command ended, managed launches already reached this path via launchAgent, and the hook server's retirePaneAuthority is designed to be called there. No blocking issues.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
… TUI (#33466) Terminals created with a flagged agent command (e.g. `omp --thinking high`) now get the agent's identity at creation, so `tui-idle` waits for the agent instead of reporting ready early. Fixes #25264 Supersedes #25320 Co-authored-by: ggbdpq <[email protected]>

ELI5
When you launch an agent through
terminal create --command "omp --model x"(flags included), Orca could not tell which agent the pane belongs to — it only recognized the bare commandomp. With the agent unknown,terminal wait --for tui-idledeclared "ready" about 2 seconds in, while the screen was still blank, and a prompt sent at that moment was silently dropped. This PR makes Orca read the agent's name from the first word of the launch command, so waits and identities behave exactly like the no-flags launch.What Changed
launchCommandLine), seeded at create/split time; adopted and restored panes have no seed and keep today's behavior.resolveLaunchCommandPaneAgentresolves the pane's agent from that command's first token, reusing the existing process-command recognition (including its headless/one-shot filtering) with aisTuiAgentguard. It is only a fallback in the existing chains: wait ranking (getPaneAgentForTuiIdle) and the publishedagentIdentitynow readlaunchAgent ?? foregroundAgent ?? commandAgent.133;D) also clears the seeded command, so a pane returning to a shell prompt is not mistaken for the agent.Why
The root cause is identity resolution, not the wait itself: the bare-command matcher (
resolveBareAgentLaunchCommand) requires an exact full-string match, so"omp --model x"correctly stays an unmanaged launch but left the pane agentless, and the agent-null wait lane is satisfied by generic evidence a real composer would never produce. Fixing the wait instead of the identity would have loosened readiness for every agent; seeding identity from the launch command fixes the one broken link and lets the existing agent-aware OMP lane (title-age + screen veto) do its job.Linked Issue
Fixes #25264
Visual Proof
N/A for attached media in this environment (headless run, no OMP environment locally). Behavior is pinned by tests: new runtime cases assert
getPaneAgentForTuiIdlereturnsompfor a flagged--commandlaunch (red before:expected null to be 'omp') and that the inherited identity retires with the launch authority; 5 unit cases cover the resolver (first-token recognition, non-agent and headless commands stay null).Testing
Commands actually run locally (macOS, clean source tree): new unit tests 5/5; the two new runtime cases plus the retirement case via
-tfilters; the fullpnpm test src/main/runtime/orca-runtime.test.tssuite 1351 passed | 1 skipped (re-run by the integrating agent on a clean tree); adjacent suites (agent-process-recognition, terminal-wait-detection, tui-idle-evidence) 194 passed;npx tsc -b config/tsconfig.node.json --forceexit 0;oxlintandoxfmt --checkclean on all 11 touched files. Real-hardware OMP timing (13–21 s composer wait reported in the issue) was not reproduced locally — the fix is pinned at the identity layer, and the OMP readiness lane itself is pre-existing, transcript-backed logic this PR does not modify.AI Disclosure
Investigation, coding and verification by GLM-5.3-Flash (ZCode agent); orchestrated, reviewed and committed by a main agent with the same model, with a human overseeing.
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
Identity-only change: no wire compatibility impact (the published
agentIdentityfield gains values it was already typed for), no Windows-specific paths touched, SSH spawns unchanged (the seed rides runtime-owned records, not spawn arguments), mobile unaffected. Known scope limit, stated in the issue's terms: plain-SSH flagged launches whose process read has not landed yet still report null identity until their foreground read arrives — same as today.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)