Repository navigation
feat(bin): add Rex runtime backend for crewmates and scouts - #1
Merged
Merged
Conversation
Add bin/backends/rex.sh, a session-provider adapter that spawns, steers, peeks, interrupts, exits, and cleans up ship and scout workers as unfocused Rex tabs, selected by --backend rex, config/backend, or auto-detection from a structurally proven Rex pane (after $TMUX and HERDR_ENV). Every rex call passes the recorded server with -S and --autostart=false, addresses sessions and blocks by full id, and strips REX_SESSION, REX_BLOCK, REX_CLIENT, and REX_SERVER. Exit 3 on a full id means gone; exit 4 means unknown. Tasks record rex_server, rex_server_instance, rex_session_id, rex_window_id, and rex_block_id. Outside Rex each home adopts or creates one firstmate session under state/.rex-session.lock and retires it with its last tab. Rex capture includes scrollback, so rex stays out of the visible-capture list. Secondmates and relaunch rebinding are refused. Add bin/fm-rex-lab.sh (private lab server with a live-server tripwire) and fm-brief.sh --rex-lab, a fake-binary suite, a token-free real-binary smoke, an opt-in live Claude guard, docs/rex-backend.md, and the verification record.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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.
Intent
I want to add Rex support /rex to firstmate, with full support for first and second mates, at the same level as the herdr support. It should use the Rex capabilties to the maximum, using its multiplexing and pane management and all other things to the maximum for an optimal development experience
Context: a planning investigation split this into three sequential phases. This task is Phase 1: a
rexruntime backend that spawns, steers, peeks, interrupts, exits, and cleans up crewmates and scouts in Rex tabs, selected by--backend rex,config/backend, or auto-detection when firstmate runs inside Rex. Secondmates and away mode (Phase 2) and Rex-native status, events, and notifications (Phase 3) follow as separate tasks.What Changed
rexruntime backend (bin/backends/rex.sh) that spawns, steers, peeks, interrupts, exits, and cleans up crewmates and scouts in Rex tabs. It is selectable via--backend rex,config/backend, or auto-detection when running inside Rex.bin/fm-backend.sh,fm-spawn.sh,fm-brief.sh,fm-control-lib.sh,fm-crew-state.sh, and related scripts were updated to route through it. Addedbin/fm-rex-lab.shas a helper script.docs/rex-backend.mdand updated architecture, configuration, scripts, runtime-backend verification, README, and other docs and skill references to cover the new backend.Risk Assessment
Testing
I ran the Rex backend contract test and the shared backend test; both pass. They cover container setup, task tab creation, targets, capture and send, agent state, kill and cleanup, listing, auto-detection and config selection, and the refusal of
--secondmateon Rex. The live Rex smoke test skipped itself becauserexis not on PATH, and the lab helperbin/fm-rex-lab.shneedsrex, so no real Rex server could be started. Every Rex-specific result therefore comes from stubs and is not live.rexCLI is not on PATH and the instructions forbid searching the host for it.bin/fm-rex-lab.shneeds it to start a private lab server. To run this live, installrexand re-run the smoke tes…Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ No issues found.
rexCLI is not on PATH and the instructions forbid searching the host for it.bin/fm-rex-lab.shneeds it to start a private lab server. To run this live, installrexand re-run the smoke tes…bash tests/fm-backend-rex.test.shbash tests/fm-backend-rex-smoke.test.sh(skipped: rex absent)bash tests/fm-backend.test.sh✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.