Repository navigation
[Bug]: OMP agent status vanishes mid-turn after any repaint of a user message (OSC 133;D retires launch authority; later hooks silently 204'd) #24436
Description
Operating system
Windows 11 10.0.26200 with WSL2 Ubuntu 24.04 (kernel 6.18.33.2, mirrored networking)
Orca version
1.4.218 (OMP 18.4.9)
Details
Summary
While an OMP turn is still running, its row disappears from the sidebar and from orca worktree ps --json (agents[]), and the pane reads as idle for the rest of the turn. OMP keeps posting status hooks, and the hook server answers every one with HTTP 204, but none of them are applied. The pane recovers only when the next prompt sends before_agent_start.
Trigger: OMP wraps every rendered user message in OSC 133 marks ending with OSC 133;D;0 (can1357/oh-my-pi#8213). Orca treats that 133;D as the launched command finishing and retires the pane's agent-status authority even though the agent is still running.
Reproduction (deterministic, no synthetic input)
- Open an OMP terminal through Orca, e.g.
orca terminal create --worktree active --command omp. - Prompt:
Use your bash tool to run exactly `sleep 60` (no other commands), then reply with the single word done. - While
sleep 60runs, confirm the agent showsworking/bash(sidebar ororca worktree ps --json). - Split that pane (
orca terminal split --terminal <handle> --direction horizontal, or Split Right in the UI). OMP gets SIGWINCH and repaints its transcript, re-emitting the user message's133;A/B/C/D;0. - Within a second the agent row is gone. It stays gone for the rest of the turn, and the turn's completion is never shown.
| Scenario (fresh Orca-launched OMP per trial) | Status mid-turn |
|---|---|
Real prompt + split while sleep 60 runs |
dropped 3/3 |
| Real prompt, no split | kept 9/9 |
Real prompt + one raw ESC]133;D;0 BEL written to the PTY mid-turn |
dropped 4/4 |
| Real prompt + switch UI to another worktree and back | kept 3/3 |
Replayed extension hooks + one raw ESC]133;D;0 BEL between two tool_execution_start |
dropped 3/3 |
| Same replay, no write | kept 3/3 |
| Same replay + split (idle OMP has no user message to repaint) | kept 3/3 |
Without any resize, 4 of 24 real-prompt trials also lost status right after submit. OMP paints the user message (two 133;A/B/C/D;0 sets within ~70 ms, confirmed with script(1)) at the same moment it posts before_agent_start, so the PTY bytes sometimes land after the hook. In daily use this shows up as long OMP turns sitting grey/idle after a resize, split, or window or sidebar change.
Root cause (1.4.218 bundle)
- The PTY fact scanner emits
command-finishedfor everyOSC 133;Din pane output. emitDaemonPtyTransientFact/ title-trackeronCommandFinished→retirePtyAgentLaunchAuthority(ptyId)→retireAgentHookCompatibilityAuthority(paneKey)→retirePaneAuthority→markPaneClosedForAgentStatus, and the status row is deleted.getAgentStatusDispositionreturnssuppressfor every event on a closed pane except a new-turn event. Forompthat is onlybefore_agent_start(Vn), sotool_execution_start,tool_execution_end,message_endandagent_endare all dropped while the hook server still replies 204.
Expected
An OSC 133;D written by a still-running agent TUI should not be treated as the launched agent exiting. Possible fixes:
- Only honor
command-finishedfor launch authority once the shell is back in the foreground or agent exit is confirmed. - Or ignore OSC 133 marks while the launched agent is the PTY foreground process.
- Or let a pane whose authority was retired accept non-new-turn events again when the event's launch token still matches the live launch.
Related
- [Bug]: Re-attached Pi pane permanently suppresses working/done status in main and renderer retired-pane tombstones #14236: the same closed-pane suppression gate (204 + only new-turn events reopen), with a different trigger (reattach + Pi event names). The fix there added
before_agent_startto the new-turn list but kept the gate. - [Bug]: OMP 17.2.12+ loses working status and can leave a spinner stuck on WSL #13890: OMP loses working status on WSL; different cause (title classification).
- [Bug]: Windows PowerShell startup agents remain listed after their process exits #18180: Orca's use of
133;Das the ended-process signal (the PowerShell side). - While writing the harness,
terminal wait --for tui-idlenever matched OMP 18.4's idle title ([Bug]: worker-start --agent omp fails at agent_readiness: OMP 18.4 idle title "π > dir" is not recognised as idle #24068).
Activity
euclodius commentedon Oct 14, 2026
Additional released-build reproduction: Windows Orca 1.4.224 paired with Linux headless Orca Server 1.4.224 in WSL2; a freshly launched OMP 18.10.4.
This is a Remote Orca Servers / paired-runtime connection, not an agent inside a managed SSH shell. The WSL connection uses direct loopback WebSocket access, so SSH is not required to reproduce the server-side status loss.
Observed sequence
sleep 45, then return a fixed completion word.tool_execution_startwithstate: working.tool_execution_end,message_end, andagent_end. A temporary observer around the existing hook transport records HTTP 204 for all of them, but the accepted host hook cache remains empty.Inspection of the installed 1.4.224 runtime shows unconditional
retirePtyAgentLaunchAuthoritycalls from both the title-trackeronCommandFinishedcallback and the daemoncommand-finishedpath. Retirement clears launch authority and the downstream disposition gate can suppress later events. This matches the mechanism described here and in #26933.Important boundary: the visible sidebar row did not reliably disappear during this isolated test; terminal-output-derived status could keep it visible even after accepted hook state was lost. An empty hook cache and immediate visual disappearance are not equivalent observations.
On a separately paired native Linux VPS, I also observed an active OMP session with a stale Done row on the Windows client, an empty host hook cache, and
terminal.agentStatusreportingisRunningAgent: true, status: idle. That existing session was not manipulated or instrumented, so its exact trigger is not proven.The stock managed status reporter was left unchanged. No Orca restart or candidate PR build was used. Temporary test terminals and the diagnostic observer were removed afterward.
Related fixes: #24732 and #24196. Please include paired Linux headless servers in the validation matrix, not only Windows-owned WSL agent terminals.
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.