Skip to content

Feature Request: Emit OSC 7501 (Program Status Protocol) escape sequences for agent lifecycle state (idle, working, done, blocked, error) #1150

Description

@biryaniwithachaar

Feature Description

Please add support for emitting OSC 7501 (Program Status Protocol) escape sequences to the terminal during interactive CLI sessions (cmd / cmdc).

Why this matters:
Terminal multiplexers and agent orchestrators like Herdr (herdr-core), Ghostty, Otty, and Rex rely on OSC 7501 to track whether a coding agent is idle, working, done, or blocked (e.g., waiting on a permission prompt or question) without fragile screen scraping. Claude Code, Codex, Pi, and Antigravity already emit OSC 7501. Right now, running cmd / cmdc inside herdr-core results in "reported": false, "status": null permanently, which breaks hc wait and status indicators.

Implementation details:
The spec is tiny (usually <20 lines of code to write to process.stdout when process.stdout.isTTY is true):

Spec: ESC ] 7501 ; state=<idle|working|done|blocked|error>:app=command-code[:kind=permission|question|auth][:msg=<base64>] ESC \

Emit state=idle on startup / ready

Emit state=working when a turn/run begins

Emit state=blocked:kind=permission (or question) when waiting on user approval in the TUI

Emit state=done (or error) when a turn finishes

Use Case

When spawning multiple instances of Command Code (cmd / cmdc) as parallel sub-agents inside Herdr (herdr-core) or terminal multiplexers (tmux), it becomes impossible to track whether each worker is actively working, finished with its turn, or stuck waiting on a permission prompt without brittle screen scraping. Right now, herdr-core detects cmdc as an agent process, but its status remains permanently null (reported: false), causing event-driven orchestration (hc wait / hc send --wait) to time out and forcing orchestrators to rely on hacky screen-quiescence polling. Emitting OSC 7501 (idle, working, done, blocked, error)—like Claude Code, Codex, Pi, and Antigravity already do—would allow terminal UIs and multi-agent orchestrators to supervise multiple Command Code instances natively and reliably.

Additional Context

No response

How important is this to you?

Blocking adoption or production use

Activity

  1. vipulgupta2048 commented on Nov 17, 2026

    @vipulgupta2048
    Member

    Thanks for the feature request @biryaniwithachaar testing this out on herdr

  2. biryaniwithachaar commented on Nov 17, 2026

    @biryaniwithachaar
    Author

    Thanks for the feature request @biryaniwithachaar testing this out on herdr

    Cool

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions