Repository navigation
Conversation
Walkthrough
Priority: Severity of issue fixed: Medium Merge Risk:
|
There was a problem hiding this comment.
🧹 Nitpick comments: 1
src/main/runtime/terminal/query/pty-terminal-summary.ts: 1
141-141:Trivial · Functional Correctness · Low value Use
paneOfPtywhenORCA_LAYOUT_OWNER=mainis enabled.Layout-owner records omit
tabIdandpaneKey, so this helper rejects their parked PTYs. The shippedorca servepath does not enable this mode, so this is not a current headless-serve blocker.Suggested fix
- if (!pty?.connected || !pty.tabId || !pty.paneKey) { + if (!pty?.connected) { return null } - const pane = parsePaneKey(pty.paneKey) + const recorded = this.paneOfPty(pty) + if (!recorded.tabId || !recorded.paneKey) { + return null + } + const pane = parsePaneKey(recorded.paneKey) if ( !pane || - pane.tabId !== pty.tabId || + pane.tabId !== recorded.tabId || this.leaves.has(this.getLeafKey(pane.tabId, pane.leafId))

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
28bd503c-f4c5-4adc-aee1-15345ecfd796
Files selected for processing: 6-
src/main/runtime/construction/runtime-construction-services.tssrc/main/runtime/construction/runtime-service-state.tssrc/main/runtime/orchestration-headless-mailbox-pointer.test.tssrc/main/runtime/terminal/output/terminal-title-observation.tssrc/main/runtime/terminal/query/pty-terminal-summary.tssrc/main/runtime/terminal/wait/terminal-wait-settlements.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
-
|
Thank you @Fede654 for this PR, and for the careful report in #33228. Your diagnosis was exactly right: on a headless We shipped the fix in #33258 and kept your design: a connected PTY becomes the mailbox target when no window publishes its pane, a real window leaf stays authoritative, and the existing idle and settled-to-type gates still decide when to type. We routed it through the PTY lookups the runtime already has ( |
ELI5
On a headless Orca server, a coordinator could be idle with new orchestration mail and never receive the prompt to check its inbox. The server kept the message, so someone had to notice it or the coordinator had to poll. With this change, the connected terminal receives the pointer when it is idle, including after it finishes a turn.
What Changed
orca servepublishes an empty renderer graph, yet the pointer delivery path required a renderer leaf. The runtime now uses a live PTY record as a parked mailbox leaf when no graph leaf exists. It reads the PTY's observed agent title and idle evidence, resolves the terminal handle for pointer submission, and offers pending mail on a working-to-idle transition. Existing graph leaves remain authoritative. Headless regressions cover arrival while idle, mail held until idle, and the delivery guards.Why
The PTY already has the connected pane identity, title and process incarnation used later in pointer submission. Reusing those records addresses the missing headless target without creating another mailbox or changing the wire protocol. PR #8057 independently proposes a background-PTY fallback and idle-edge tests; this work credits that approach and adds controlled real-PTY headless validation. The fix retains the existing settled-idle and pointer submission checks.
Linked Issue
Fixes #33228
Visual Proof
This behavior is terminal input, so the fake-agent stdin ledger is the direct before/after proof. Both arms ran on the same Linux headless hub with the same frozen harness (SHA-256
a3571c645b0dc0140aed93fe615e62beb48967e8c1c800cb1d8c9c839ea14a52), distinct disposable profiles, and no real model account.Before, unpatched
265f143ab8d769139c108d1648af66eae1187a81:After, audited
d3b5d08e88a726ea8f9faac4e4b5d0392a74f298:The first pointer followed mail sent while idle. The second followed a live
Codex working→Codex donetransition; the ledger stayed unchanged while working. Both fixed DB rows acquired settleddelivered_attimestamps and remained unread because the harness did not runcheck.Testing
Local build from immutable source archives:
pnpm install --frozen-lockfile,ORCA_BACKGROUND_LAUNCH=1 pnpm build:cli,ORCA_BACKGROUND_LAUNCH=1 pnpm build:mobile-web,ORCA_BACKGROUND_LAUNCH=1 pnpm build:orcad. Baseline orcad0.1.0+9e1634c6008e; fixed orcad0.1.0+aa9a66ee374a. Each built package includedorcad/and its sibling pinnedruntimes/Node.The hub test ran
/tmp/orca-orchestration-audit/hub-validation/mailbox-live-smoke.mjsonce per arm withredorgreen, undersystemd-run --scope --uid=orca -p MemoryMax=1536M -p CPUQuota=100% -p TasksMax=128andORCA_REQUIRE_CGROUP_CAP=1 ORCA_BACKGROUND_LAUNCH=1. It verified the cap, used a loopback port and fresh HOME/profile/workspace/Run, and stopped each case's server, daemon and PTY. Full commands, artifact hashes, sanitized ledgers and isolated DB summary are in the validation handoff report. Production remained active on port 6768 with the same PID and bundle hashes before and after. The harness verified its own and server cgroup, but did not record separate daemon/agent cgroup membership, an isolated-port-close check, or an empty-scope query; it did record case-owned process cleanup as empty.The final read-only auditor ran
ORCA_BACKGROUND_LAUNCH=1 pnpm test src/main/runtime/orchestration-headless-mailbox-pointer.test.ts: 10/10 passed. The implementer reported 80 related tests,pnpm tc:node, and the changed-file quality gate passing; the exact related-test command and quality output were not preserved in this handoff. The fake agent proves pointer bytes and Enter reached a real PTY. It does not prove a real model consumes the prompt; macOS, Windows, SSH execution and mixed-version peers were not exercised.AI Disclosure
GPT-6 Sol (medium) Codex workers implemented and audited the fix. A Codex validation worker built both artifacts and ran the isolated real-PTY before/after test; the final read-only auditor independently reran the focused suite.
Review
Agent skill upstream boundary
Notes
The execution host owns the PTY and status evidence. The change adds no RPC fields or stream opcodes. It keeps platform-dependent behavior within the existing runtime path and does not assume a Git worktree; the live harness used a disposable Git worktree, while the implementation also accepts parked PTY identities. No production service, profile, inspector or mail was modified during validation. The experimental
ORCA_LAYOUT_OWNER_IS_MAINpath is still unable to reconstruct a parked leaf for a main-owned pane with no graph leaf, because that mode removes the PTY's copied tab/pane fields. This was already broken in the baseline; the switch is off in shipped builds. The final read-only audit found no actionable issue on the shipped path.Checklist
pnpm tc:node, changed-file quality checks and local orcad builds passed as described above)