Repository navigation
Conversation
|
No actionable comments were generated in the recent review.
|
There was a problem hiding this comment.
ℹ️ No critical issues — one maintainability suggestion inline.
Reviewed changes
- Mid-turn repaint no longer retires launch authority: both
command-finishedtrigger sites now call a newretirePtyAgentLaunchAuthorityOnCommandFinished, which skips retirement only while a fresh, live hook row for a resident Pi-family agent shows a non-idle state; everything else falls through to unconditional retirement. - Regression coverage:
omp-repaint-launch-authority.test.tsdrives a real hook server + runtime through both trigger paths (byte133;Dand daemon transient fact) and asserts authority and theworkingrow survive a mid-turn repaint, later hooks still apply, and a real turn end / PTY exit still retire. Verified passing locally alongside the STA-4557opencode-finished-session-authoritysuite.
I checked the two design questions this PR turns on and both hold: the class-mixin chain makes the new protected method reachable at both call sites (the fresh test exercises it), and a fresh done row really is terminal for Pi-family agents — OMP suppresses willContinue === true and Pi/prime gate on ctx.isIdle() (src/main/pi/agent-status-handler-source.ts:277), so !== idle is consistent with the STA-4557 behavior the PR preserves. onPtyExit correctly stays unconditional. The one thing worth tightening is the hand-rolled resident set.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
|
Released-build evidence relevant to the two retirement sites changed by this PR: Windows paired client 1.4.224 + Linux headless server 1.4.224 + fresh OMP 18.10.4. The WSL host is reached directly over loopback WebSocket, so this reproduction does not require SSH. An isolated This is evidence for the bug and the relevance of your changed call sites, not validation of this PR; I have not run its branch. The visible row sometimes survived through terminal-output-derived status, so UI appearance alone can mask the lost hook state. For a live paired-headless check, please verify accepted hook state across both a mounted resize/split and a parked daemon scan, including completion after the repaint. Real PTY exit must still clear authority. Could you clarify whether the disclosed renderer-side identity drop requires a separate fix/release for paired clients, and which released server/client versions will contain the complete behavior? Detailed isolated reproduction: comment on #24436. AI assistance disclosure: prepared with an OpenAI coding assistant via OMP, using my reported behavior and local runtime diagnostics/source inspection. Reproduction and validation limits are stated above. |
5096577 to
f62baf4
Compare
…turn A resident Pi-family TUI (omp, pi, prime-agent) repaints its transcript on resize, split, or sidebar switches, re-emitting the rendered user message's OSC 133;A..D marks while the turn is still running. Every `command-finished` fact unconditionally retired the pane's launch authority, and the closed-pane gate then 204-suppressed every later mid-turn hook (tool_execution_start/end, message_end, agent_end), so the status row vanished until the next prompt (stablyai#24436). Even without a resize, the hook/post-paint race dropped status on 4 of 24 real-prompt trials. Both command-finished trigger sites (byte-path title tracker and daemon transient fact) now skip retirement when the PTY has a fresh explicit agent status row from a resident turn source whose state is not idle: while that row is live, the 133;D mark cannot be the launched command ending. Everything else keeps today's unconditional retirement — non-resident agents, ended (done) rows, rows outside the freshness window, and the real `onPtyExit` path — preserving the STA-4557 opencode semantics where 133;D is a session boundary. Fixes stablyai#24436 Generated-by: GLM-5.3-Flash (ZCode)
…entType RESIDENT_AGENT_TURN_SOURCES re-stated the PiAgentKind union that isPiCompatibleAgentType already owns, so a future Pi-family kind could be silently omitted from the command-finished retirement gate. Import the helper instead; the set of gated agent types is unchanged. Generated-by: GLM-5.3-Flash (ZCode)
…-id spawn contract The launch path now hands spawn pane ids (worktree/tab/leaf) instead of a raw env blob, and pane binding is committed by the committingSpawn fixture. Use spawnedPtyEnv + committingSpawn like the sibling opencode-finished-session-authority harness so the four repaint/retire assertions exercise the same wiring on the current base. Generated-by: GLM-5.3-Flash (ZCode)
|
Thanks @euclodius for the released-build evidence and the cross-references — the accepted-hook-cache-empty observation and the unconditional retirement in both the title-tracker and daemon command-finished paths match exactly the two call sites this PR changes. On your verification ask: the rebased head now pins all four behaviors you named in
On the renderer-side identity drop and versions: this PR only changes runtime launch-authority retirement; the renderer-side identity behavior you saw is a separate surface it does not touch. Note the paired/mobile projection side independently changed on main via #32195 (an idle-title repaint no longer retires a fresh working hook in the projection). Whether a paired-client release needs to bundle both, and which versions carry them, is @nwparker's call — I can't speak to release planning. Status: rebased onto a886dcd today. The October runtime reorganization had moved both call sites into @nwparker gentle ping — happy to adjust anything. |
|
@ggbdpq Thanks for the detailed follow-up and for adding the four lifecycle cases. Those line up with the runtime guards raised in my earlier comment. I also appreciate the explicit distinction between launch-authority retirement and the separate renderer/projection behavior. Our current released-build update is Orca 1.4.240 across the paired Windows client and both Linux Electron servers, with OMP 18.12.6. Agent status seems to be working normally on that setup at the moment. |
|
Thanks @euclodius — the 1.4.240 data point settles it. Your report led me back to what actually landed: #30273 (merged Oct 18, first shipped in v1.4.230) fixes this at the OSC 133 scanner layer — OMP's back-to-back bubble markers ( That covers both call sites this PR conditionalyzed, from one level closer to the root cause, and your released-build confirmation plus #24436's closure is the end-to-end evidence this branch could not produce locally. Closing this in favor of #30273 — the call-site guards it added are no longer needed with the misfire eliminated upstream. Should a hook-state loss ever reappear through a path the scanner doesn't cover, the four pinned lifecycle behaviors in this branch's history (repaint, daemon transient fact, done-row retirement, real PTY exit) document the expected semantics to reopen against. |

ELI5
Orca watches agent terminals for the shell's "command finished" signal (OSC 133;D). But agent TUIs like OMP also emit that same signal when they merely redraw their transcript — resizing the window, splitting a pane, or switching the sidebar all trigger a redraw. Orca mistook those redraw marks for "the agent's command ended", tore down the pane's agent-status authority, and then silently discarded (HTTP 204) every status update the agent sent for the rest of its turn. The agent kept working; Orca just showed it as idle/gone until the next prompt. This PR ignores the "command finished" signal from a redraw while the agent's own status row still shows a live turn.
What Changed
Both
command-finishedtrigger sites — the byte-path title tracker (orca-runtime-get-unpersisted-tracked-title-for-pty.ts) and the daemon transient-fact path (orca-runtime-emit-daemon-pty-transient-fact.ts) — previously calledretirePtyAgentLaunchAuthority(ptyId)unconditionally. They now call a newretirePtyAgentLaunchAuthorityOnCommandFinished(ptyId), which skips retirement only when the PTY has a fresh explicit agent status row (via the existingselectFreshExplicitAgentStatusRow, same freshness window as everywhere else) whose agent is a resident turn source (pi,omp,prime-agent— the Pi family whose turn boundaries are their ownbefore_agent_starthooks, not the shell command a 133;D would close) and whose mapped state is not idle.Everything else is unchanged: non-resident agents, ended (
done) rows, rows outside the freshness window, and the realonPtyExitpath all keep retiring today. The user-visible before/after: an OMP turn no longer goes grey/idle mid-turn after a resize, split, or sidebar change —orca worktree pskeeps showing the row, and mid-turn hooks are applied instead of 204'd.Why
The bug is not in the closed-pane suppression gate itself (that gate is intentional and #14236 kept it deliberately) — it is that a redraw mark was misread as authority-retirement evidence. Fixing at the shared judgment point (the two trigger sites' retirement call) heals every dispatch surface that funnels through managed worktrees, instead of teaching the downstream disposition to second-guess retirement. Scoping the skip to the Pi family preserves the STA-4557 semantics pinned in
opencode-finished-session-authority(opencode's 133;D is a real session boundary and must retire), and the freshness window bounds the skip so a stale or crashed row can never pin authority forever.Alternatives considered and rejected: foreground-process/presence gates (OMP hooks carry no process identity and WSL foreground reads are unavailable — the gate would silently no-op exactly in the reported environment); ignoring 133;D whenever a launch agent is set (would break real exit detection for shell-wrapped panes); accepting non-new-turn events downstream when the launch token still matches (a downstream patch over a misjudgment upstream).
Linked Issue
Fixes #24436
Visual Proof
N/A — no UI surface change; the fix is main-process authority bookkeeping observable through
orca worktree ps --jsonrows and hook acceptance. The regression test asserts the before/after at those seams (attest stays non-null, snapshot row staysworkingacross a mid-turn repaint; later hooks still land).Testing
New
omp-repaint-launch-authority.test.tsdrives a realAgentHookServer+OrcaRuntimeServicethrough the public seams (real HTTP hook endpoint,onPtyDatabyte injection,emitDaemonPtyTransientFact,onPtyExit): mid-turn repaint keeps authority and theworkingrow on both trigger paths and later hooks still apply; a genuinely ended turn and a real PTY exit still retire. Local matrix: aggregateorca-runtime.test.ts1341 passed / 1 skipped (pre-existing skip, covers all specs feeding 133;D); STA-4557 opencode authority and adjacent authority/lifetime suites 49/49;pnpm tcclean; oxlint clean on changed files. Manual end-to-end against a real OMP/WSL2 setup was not run in this environment. Known residual, disclosed: the renderer-sidepane-agent-identityrow drop on command-finished is untouched (a transient drop that the next accepted hook rebuilds); a mid-turn repaint during an interactive-shell-wrapped crash inside the freshness window defers retirement until the 30-minute staleness clock or PTY exit.AI Disclosure
Implemented by GLM-5.3-Flash (ZCode agent) under direction of ggbdpq, who reviewed the diff and re-ran the new and protected test suites.
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
Cross-platform: the gate reads only in-process hook state, no platform APIs; SSH/daemon paths go through the same two trigger sites. No persistence, protocol, or backwards-compatibility impact — retirement behavior for every pre-existing case is byte-identical, and the new skip is bounded by the existing freshness window (also the fallback cleanup clock).
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)