Skip to content

[Other]: OSC 9999 agent-status sequence is undocumented — any TUI can report to the Agent Dashboard with one printf #14033

Open

Description

@flight505

Details

Orca parses an OSC 9999 status sequence on every PTY, turning any process into a first-class Agent Dashboard citizen. It is implemented, tested, and — as far as I can find — documented nowhere.

At e5cd5bf5:

  • src/shared/agent-status-osc.ts — OSC_AGENT_STATUS_PREFIX = '\x1b]9999;', with cross-chunk carry handling
  • src/shared/agent-status-types.ts:16 — AGENT_STATUS_STATES = ['working', 'blocked', 'waiting', 'done']
  • src/shared/agent-status-osc.test.ts — split-chunk and terminator coverage (BEL and ST)
  • Parsed in pty-transport.ts / pty-connection.ts before xterm, with no agent gate

Verified live. From an ordinary shell in an Orca terminal — no agent, no hook, no recognised process name:

printf '\033]9999;{"state":"working","agentType":"gnhf-probe","prompt":"osc probe"}\007'

orca worktree ps --json then reported:

{"agentType": "gnhf-probe", "state": "working", "prompt": "osc probe"}

A full card, with an arbitrary agentType string. Closing the tab removed it cleanly.

Why this is worth documenting. The Agent Dashboard is otherwise blind to TUI tools: a card needs a hook-reported agent or a title matching a known CLI in src/shared/agent-title-identity.ts. So long-running terminal tools — build loops, validation pipelines, agent harnesses — are invisible, and their users conclude the dashboard is only for Orca-spawned agents. One printf fixes that, and state: "blocked" puts the pane in Needs You, which is exactly the "this one is waiting on a human" signal such tools need.

I found it by reading src/shared/. Every tool author who would benefit is currently building title heuristics or polling instead.

Ask: document the sequence — its shape, the four states, the agentType/prompt fields, and the stability intent. A short page under docs/reference/ would do it. If it is deliberately internal and subject to change, saying that is just as useful, since right now people will find it and depend on it anyway.

Happy to draft the page if the shape is confirmed stable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions