Repository navigation
[Feature] Terminal program status reporting over OSC 7501 #4059
alfredbirkelund
started this conversation in
Feature requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Feature Summary
Add support for the OSC 7501 Program Status Protocol across Prime Agent's interactive TUI and CLI. This allows modern terminal emulators and agent workspace managers/multiplexers (e.g., Ghostty, Herdr, Contour) to natively track whether Prime Agent is
idle(waiting for prompt/input),working(streaming/thinking/executing tools), orblocked(awaiting confirmation), without requiring fragile screen-scraping or heuristic log matching.Motivation
Workspace multiplexers such as Herdr (and terminals like Ghostty) use OSC 7501 escape sequences (
ESC ] 7501 ; state=<state>:app=prime-agent ESC \) to display live agent badges, show status notifications, and determine turn transitions. Other coding agents (such as Claude Code and Antigravity) already emit these standard sequences. Adding OSC 7501 makes Prime Agent a first-class citizen in these environments.Proposed Changes
crates/pa-tui/src/osc7501.rs:idle,working,blocked:kind=permission,done,error, andclear.PRIME_AGENT_OSC7501=off|0|false|nofor opt-out; active on terminals by default.state=idlewhen awaiting prompt or inside the agents view.state=workingwhen an agent turn or compaction is active.state=blocked:kind=permissionwhen modal confirmation is requested.state=clearupon surface exit and inrestore_terminal.state=workingwhile executing turn, thendone/errorandclear.Implementation & PR Reference
A focused patch adhering to the repository's
AGENTS.mdguidelines and zero-warning policy with full unit test coverage is submitted as PR #4058. Posting here to align with the discussion-first contribution process.All reactions