Skip to content

Deliver feedback to agents in Rex, or through a pluggable delivery command #136

Closed

Description

@ian-pascoe

Problem
plannotator-tui can deliver feedback only to an agent in Herdr (herdr agent prompt) or to the clipboard. Rex is another terminal multiplexer built for coding agents, and it has everything the Herdr integration uses. Its rex CLI can:

  • open a split or popup pane running a command;
  • report what a pane runs: rex block call -b BLOCK process (foreground pid, name, cwd) and program_status (the app, such as pi, and the state idle / working / blocked / done / error);
  • read a pane's output: rex capture -b BLOCK --trim --unwrap;
  • type into a pane: rex send and rex send-key.

For now I run plannotator-tui in Rex by pretending to be Herdr. A script sets HERDR_ENV=1 and points HERDR_BIN_PATH back at itself, then runs plannotator-tui herdr pane. It answers the four herdr commands the pane runs with rex:

herdr command What the script does
agent prompt Pastes the feedback with bracketed paste and presses Enter. Returns agent_blocked while the program status is blocked.
pane get Reports the app from the program status, or the name of the foreground process.
pane read Reads the pane's output with rex capture.
agent read Same as pane read.

This works well: Send, Approve and the agent label all behave as they do in Herdr. But it depends on HerdrEnv and the herdr arguments, which are internal and could change in any release.

Checked against plannotator-tui 0.9.9.

Proposal, in order of preference:

  1. A delivery target that isn't tied to one multiplexer. For example, PLANNOTATOR_TUI_DELIVER_CMD: a program that gets the feedback on stdin and reports blocked or unavailable through its exit code, or the same JSON envelope parse_response already reads. Herdr, Rex, tmux and others could each plug in a one-line script, and Delivery stays the only seam.
  2. Built-in Rex support in the style of herdr: a RexAgent delivery through rex send / rex send-key, plus plannotator-tui rex open|last|terminal launchers driven by REX_BLOCK.
  3. At least make the herdr contract public. Document the commands and JSON shapes the pane expects from HERDR_BIN_PATH, so a shim like mine doesn't break unnoticed.

I'm happy to send a PR for whichever option you prefer.

Activity

  1. backnotprop commented on Nov 10, 2026

    @backnotprop
    Contributor

    Thanks for the detailed write-up and the shim. #127 adds built-in Rex support (plannotator-tui rex open|last|terminal), which is your option 2, and should land soon. It currently sees Node agents like pi as node; a follow-up will read Rex's program_status app so pi gets Send. A pluggable PLANNOTATOR_TUI_DELIVER_CMD (your option 1) is welcome as a separate PR if you'd still like it.

  2. backnotprop commented on Nov 15, 2026

    @backnotprop
    Contributor

    Thanks again for the write-up, @ian-pascoe. Your option 1 is in #151 (merged), alongside the built-in Rex (#127, #140) and herdr-core (#129) hosts.

    • Setting it: PLANNOTATOR_TUI_DELIVER_CMD, or [deliver] command in the config. The env var wins over the config.
    • How it runs: sh -c on unix, cmd /S /C on Windows, so pipelines work. The feedback is on stdin, and PLANNOTATOR_TUI_REVIEW_PATH names the file or folder under review.
    • Exit codes: 0 delivered (the first stdout line joins the status), 75 blocked (copies; E retries), 69 unavailable (copies), anything else failed with stderr. The review stops the command after 30 s.
    • Where it sits: a target a Herdr, Rex or hc launcher named for the review comes first; the command replaces the clipboard everywhere else. The header shows it as cmd · <program>.
    • Pi: plannotator-tui pi send --session <id> works as the command.

    Details are in the README under "Any other agent: a delivery command".

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