Skip to content

[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

@Chrrxs

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)

  1. Open an OMP terminal through Orca, e.g. orca terminal create --worktree active --command omp.
  2. Prompt: Use your bash tool to run exactly `sleep 60` (no other commands), then reply with the single word done.
  3. While sleep 60 runs, confirm the agent shows working/bash (sidebar or orca worktree ps --json).
  4. 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's 133;A/B/C/D;0.
  5. 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)

  1. The PTY fact scanner emits command-finished for every OSC 133;D in pane output.
  2. emitDaemonPtyTransientFact / title-tracker onCommandFinished → retirePtyAgentLaunchAuthority(ptyId) → retireAgentHookCompatibilityAuthority(paneKey) → retirePaneAuthority → markPaneClosedForAgentStatus, and the status row is deleted.
  3. getAgentStatusDisposition returns suppress for every event on a closed pane except a new-turn event. For omp that is only before_agent_start (Vn), so tool_execution_start, tool_execution_end, message_end and agent_end are 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-finished for 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

Activity

  1. euclodius commented on Oct 14, 2026

    @euclodius

    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

    1. Launch an isolated OMP terminal and ask it to run only sleep 45, then return a fixed completion word.
    2. While the command runs, confirm the host hook cache contains tool_execution_start with state: working.
    3. Split the diagnostic pane while the command is still running. The accepted hook entry disappears before the tool finishes.
    4. OMP subsequently emits tool_execution_end, message_end, and agent_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 retirePtyAgentLaunchAuthority calls from both the title-tracker onCommandFinished callback and the daemon command-finished path. 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.agentStatus reporting isRunningAgent: 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions