Repository navigation
feat(rex): Rex Annotate, plus popup placement and Node agent detection - #140
Merged
Merged
Conversation
`rex open|last|terminal|find` always opened a split. `--placement popup`, or `[rex] placement = "popup"` in the config file, opens a floating layer over the agent's own window instead, so a launch from a block in a background tab does not land over the active one. A split stays the default because it keeps the agent in view. Rex has no overlay, so the setting takes only split or popup.
A block running pi showed Copy instead of Send. pi runs under node, so Rex reports its process as `node`, and `cli.js` when it is run as a script; neither names an agent. The agent's program status does: Rex 1913 has `app: "pi"` on a record whose owner is the foreground pid. The launcher now takes the agent from that record (`claude-code` is Claude), then from the process name, then from the script Rex reports an interpreter running. A record left by another process names nothing.
Rex has no plugin manifest, so getting a review on a key meant pasting
Lua into init.lua by hand, with the binary's full path, since Rex runs
actions with a bare PATH. `plannotator-tui rex install` writes Rex
Annotate to plannotator/annotate.lua beside Rex's init.lua (following
REX_CONFIG and XDG_CONFIG_HOME). The module is embedded in the binary
and names it by absolute path, so reinstalling after an upgrade keeps
the two in step.
The module defines six palette actions (annotate_last, annotate_newest,
annotate_open, annotate_gate, annotate_terminal, annotate_find), each
running `plannotator-tui rex …` on the focused block, and binds three
keys Rex for Mac leaves free: Shift+Cmd+O, Alt+Shift+Cmd+O, Ctrl+Cmd+O.
`setup{ placement, keys, bin }` changes them.
Install never edits init.lua: it prints the require line, and checks
the module with `rex config check` against a scratch copy, so the
person's own config is not read. --dry-run says what it would write;
--print writes the module to stdout.
"Inside Rex" becomes "Rex Annotate": install the binary, run
`plannotator-tui rex install`, add the require line, reload. A table
lists the keys and actions, then `setup{}` options, `[rex] placement`,
and the launchers. It also says how the agent is found, so pi under
node gets Send.
This was referenced Nov 14, 2026
Merged
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add Rex Annotate: Herdr Annotate's reviews, on a key in Rex. Rex has no plugin manifest, but its
init.luacanrequireLua files stored beside it. So Rex Annotate is a Lua module that this binary embeds and writes. Follows #127. Refs #136.Shift+Cmd+Oannotate_lastplannotator-tui rex lastAlt+Shift+Cmd+Oannotate_newestrex last --newestCtrl+Cmd+Oannotate_openrex open(the pane's folder)annotate_gate,annotate_terminal,annotate_findrex open --gate,rex terminal,rex findRex for Mac binds none of these keys.
setup{ placement, keys, bin }changes them;keys = falsebinds none. The actions run in the Rex server, so the app's Remote Control can stay off.Three changes:
--placement split|popup, or[rex] placementin the config file. A popup is a floating layer in the agent's own window (session.describe_block→session.new_layer). Split stays the default.node, so feat(rex): open reviews in rex and send feedback back #127 sawnodeand offered Copy, not Send. The launcher now reads theprogram_statusrecord owned by the foreground pid (effective_app, thenapp;claude-codeis Claude), then the process name, then thescriptRex reports for an interpreter.rex install [--dry-run | --print]. It writes the module beside Rex'sinit.lua($REX_CONFIG, else$XDG_CONFIG_HOME/rex, else~/.config/rex), naming this binary by its absolute path, because Rex runs actions withPATH=/usr/bin:/bin:/usr/sbin:/sbin. It never editsinit.lua; it prints therequireline. It runsrex config checkon a scratch copy (the module plus therequireline in a temp dir), so the person's config is not read.Evidence
On a throwaway Rex server (build 1921, server
0.1.0-preview.14, API 12) with its own socket and config dir. Fake agents: a Cclaudeand a Nodepiat…/pi-coding-agent/dist/bundle/cli.js. Both report OSC 7501 status, turn on bracketed paste, and log their input.Copy 0 new across 0 files (E).After:
Send 0 new across 0 files ▸ pi in 306755 (E).rex installprintedcreated …/plannotator/annotate.lua, therequireline, andrex config check: the module loads cleanly. Run again:unchanged.--dry-runwrote nothing. Withoutrexit printedskipped rex config check.rex config checkon the config dir with the module andrequireline:bindings: 3,actions: 6. Afterrex config reload,rex keymaplists the three keys fromplannotator/annotate.lua.rex do annotate_open --origin keyon claude: split; comment;E. claude received\x1b[200~# Annotations on plan.md … > Claude: tighten step two.\n\n\n\x1b[201~\r.[rex] placement = "popup"and another window active,annotate_openon pi openedfloating [0.05, 0.075, 0.9, 0.85]in pi's window, focused. Send: pi received\x1b[200~# Annotations on plan.md … > Pi: say what one step means.\n\n\n\x1b[201~\r.setup{ placement = "split" }overrode the config popup.placement = "sideways"failed the action withunknown Rex placement "sideways"; expected split or popup.keys = falsebound none.New tests, for example:
cargo fmt --all --check,cargo clippy --workspace --all-targets -- -D warningsandcargo test --workspacepass (483 tests).Not verified: a real keypress in the Rex app (the throwaway server had no app attached), real Claude/pi transcripts for
annotate_last, and Windows (CI'scheck-windows).Merge Danger
Door: two-way
Everything is under
plannotator-tui rex …and the new[rex]config table. A revert removes it. People who installed the module keep a Lua file that calls flags which would then be gone.Blast Radius: Rex
A Rex launch now asks for
program_statusbefore opening. If Rex can't answer, the process name decides, as before. The config file gains[rex]; an unknown value there is an error that names it, as in[herdr].