Skip to content

feat(delivery): send feedback through any command with PLANNOTATOR_TUI_DELIVER_CMD - #151

Merged
backnotprop merged 1 commit into
mainfrom
feat/deliver-cmd
Nov 15, 2026
Merged

backnotprop merged 1 commit into
mainfrom
feat/deliver-cmd

Conversation

@backnotprop

Copy link
Copy Markdown
Contributor

Summary

This adds a plug-in delivery target for agents and multiplexers that plannotator-tui has no built-in support for. Herdr, Rex and herdr-core stay built in.

Set PLANNOTATOR_TUI_DELIVER_CMD, or [deliver] command in the config, to a command line. Send (E) runs it with the feedback on stdin. The command's exit status is the outcome:

Exit Outcome The review
0 delivered marks the notes sent; the first stdout line, if any, joins the status
75 (EX_TEMPFAIL) Blocked: the agent cannot take a message now copies the feedback; E retries
69 (EX_UNAVAILABLE) Unavailable: there is no agent to send to copies the feedback; E retries
anything else Failed shows the first line of stderr

Decisions:

  • Shell: the line runs with sh -c on unix and cmd /S /C "<line>" on Windows, through raw_arg so the line arrives as written. Pipelines and variables work.
  • Environment: PLANNOTATOR_TUI_REVIEW_PATH is set to the file or folder under review, when there is one. Everything else is inherited, including PLANNOTATOR_TUI_DELIVER_AGENT when a launcher set it.
  • Precedence: a Rex, hc or Herdr target that a launcher named for this review comes first, because it names one agent for one review. A command set in a shell rc or the config would otherwise take over every Herdr Annotate review. The command replaces the clipboard everywhere else. The env var wins over the config. A gated review with no launcher still answers its caller. P can still switch Send to a Pi session.
  • No hangs: the review waits for the command and stops it after 30 s. Stdin is written, and stdout/stderr read, on their own threads, so a command that never reads stdin, or prints first, cannot deadlock. A background child that keeps stdout open (cmd &) does not hold the review up either.
  • Label: describe() is cmd · <program>, the first word's file name, skipping VAR=value. For example: Send 3 new ▸ cmd · tmux (E).
  • Pi: plannotator-tui pi send --session <id> already works as a delivery command. The README shows it.

Code: src/delivery/command.rs (the target) and delivery/command/tests.rs. config.rs gains [deliver] command. In cli.rs, review_delivery puts the command between agent_pane() and the clipboard, and plannotator-tui config shows the value that applies, as it does for the theme.

Tests

The tests run real shells and tiny scripts:

  • exit 0/75/69/3 through the real shell. These run on every platform, Windows included, because exit N means the same to sh and cmd.
  • unix: a pipeline gets the feedback on stdin and PLANNOTATOR_TUI_REVIEW_PATH, and its stdout line becomes the notice.
  • unix: blocked and missing agents carry the command's stderr; a missing program fails with 127.
  • unix: the review never hangs: 1 MiB unread on stdin, sleep 5 & echo sent, and a command that never finishes (stopped by the timeout).
  • pure: the exit-status mapping, env over config, blank means unset, the label.
  • config: [deliver] command parses and shows in plannotator-tui config.

cargo fmt --all --check, cargo clippy --workspace --all-targets -- -D warnings, cargo test --workspace and python3 herdr/test-manifest.py pass on macOS. Windows runs in CI; I could not cross-compile it here.

Closes #136

…I_DELIVER_CMD

The command line runs in the shell with the feedback on stdin. Exit 0 is
delivered, 75 blocked and 69 unavailable (both copy), anything else failed
with stderr. [deliver] command sets it in the config. A target a Herdr, Rex
or hc launcher named still comes first; the command replaces the clipboard.
@backnotprop
backnotprop added this pull request to the merge queue Nov 15, 2026
Merged via the queue into main with commit 6e0217f Nov 15, 2026
3 checks passed
@backnotprop
backnotprop deleted the feat/deliver-cmd branch November 15, 2026 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant