feat: add Chief fleet picker - #1
Conversation
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
📝 WalkthroughWalkthroughThe pull request documents and exposes an optional ChangesFleet entrypoint
Estimated code review effort: 3 (Moderate) | ~20 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
test/fleet.test.mjs (1)
143-150: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick winAssert the picker-to-agent environment contract.
runFleetAgentrequiresHERDR_RELAY_AGENT_NAME,HERDR_RELAY_AGENT_LABEL, andHERDR_RELAY_ATTACH_MODE. This test checks onlyHERDR_RELAY_RESIDENT_CHIEF. Assert these values for everyplugin.pane.openrequest so a broken picker environment mapping cannot pass this suite.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@test/fleet.test.mjs` around lines 143 - 150, Update the assertions for each open request in the loop over opens to also validate the picker-to-agent environment contract: assert HERDR_RELAY_AGENT_NAME, HERDR_RELAY_AGENT_LABEL, and HERDR_RELAY_ATTACH_MODE in open.params.env. Keep the existing resident-chief assertions and use the expected mapped values for each request so all plugin.pane.open calls are covered.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@README.md`:
- Around line 130-136: Update the “Open the local broker fleet” instructions
near the herdr plugin command to state that the fleet entrypoint is supported
only on Linux and macOS, and cannot be opened on Windows.
In `@test/fleet.test.mjs`:
- Around line 72-78: Update the picker failure test around fleetPickerMain to
inject BrokerUnavailableError through listAgents instead of relying on default
runtime dependencies, and capture console.error during execution. Assert the
error output includes the project directory and “agent-relay node up”, while
preserving the existing dismissed and process.exitCode assertions.
---
Nitpick comments:
In `@test/fleet.test.mjs`:
- Around line 143-150: Update the assertions for each open request in the loop
over opens to also validate the picker-to-agent environment contract: assert
HERDR_RELAY_AGENT_NAME, HERDR_RELAY_AGENT_LABEL, and HERDR_RELAY_ATTACH_MODE in
open.params.env. Keep the existing resident-chief assertions and use the
expected mapped values for each request so all plugin.pane.open calls are
covered.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: da0c4ed6-81ce-4155-b707-4a6b7336bd77
⛔ Files ignored due to path filters (3)
dist/fleet-agent.mjsis excluded by!**/dist/**dist/fleet-picker.mjsis excluded by!**/dist/**dist/fleet.mjsis excluded by!**/dist/**
📒 Files selected for processing (4)
README.mdherdr-plugin.tomlpackage.jsontest/fleet.test.mjs
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3ec58d760b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
All reported issues were addressed across 7 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Brings in #1 (fleet picker) and its review fixes now that main carries them. One conflict, confined to dist/fleet-picker.mjs's import block. Resolved by keeping T3's body — the picker no longer calls pane.report_agent or sets HERDR_RELAY_INITIAL_STATE, leaving the pane's own projector as the single writer of its agent state — and keeping T4's shared openedPane import. projectBrokerState and brokerStateMessage are dropped: main deleted their only call sites in this file, so retaining them would leave unused imports. The two branches converged on the same principle from opposite ends: T3 removed the picker's node-side status write, T4 declined to add one in the fleet node.
Summary
fleetplugin entrypoint that project-scoped lists live agents withagent-relay node agent listRelay fleetHerdr workspace with one Chief-cwd attach pane per listed agentagent-relay node agent attachand the resident Chief withsh scripts/chief.sh braincurrent_statethroughpane.report_agent, map toidle|working|blocked|unknown(neverdone), poll every five seconds, and report only mapped changesT1 bridge/setup/status-forwarding implementation is unchanged. This PR does not apply the
herdr-pluginGitHub topic.Acceptance and verification
Named T3 assertions:
fleet picker opens exactly one Chief-cwd attach pane per live broker agentstatus polling reports the initial projection once and then only broker changesmaps authoritative broker states to Herdr states without emitting donelists agents project-scoped and replaces raw broker-down errors with a readable failurefleet picker failure waits for dismissal when its pane is interactivefleet panes attach through agent-relay while the resident Chief uses chief.shfleet agent gives the attach process the pane TTY and project cwda failed status report is retried instead of suppressing the broker changeAutomated evidence:
node --test test/fleet.test.mjs: 11 passed, 0 failednpm test: 25 passed, 0 failed, 1 Windows-only skipnode --checkon all three new runtime modulesgit diff HEAD --check: cleannpm audit --omit=dev: 0 vulnerabilitiesLive evidence against the real Chief broker:
chief-khaliqas the resident Chiefmarketing-lead --mode view; the real Claude TUI streamed intactherdr pane getandherdr agent listboth showedagent=claude,agent_status=idle/private/tmpproduced the readable broker recovery message rather than the raw missing-connection errorReview gate disclosure
NOT SATISFIED: the AGENTS.md Veto gate is not satisfied. The Veto MCP tools, including
veto_diff_review, were unavailable in this session, so no Veto verdict exists.Before intent-to-add,
git diff HEADwould not include the four untracked files (dist/fleet.mjs,dist/fleet-picker.mjs,dist/fleet-agent.mjs, andtest/fleet.test.mjs), so a diff-based review at that point would have been blind to the new runtime and test code. Before the final complete diff review, all four were made visible withgit add -N; the resulting 737-line HEAD diff was then reviewed manually and checked as described above. This does not substitute for or satisfy the unavailable Veto gate.Low-severity design assumptions
agent-relayresolves from the pane processPATH.scripts/chief.shis intentionally relative and therefore relies on the plugin opening the pane with the Chief project as its cwd.Summary by cubic
Adds a Chief fleet picker that turns a project-scoped
agent-relaybroker into a Herdr workspace by opening one attached pane per live agent and projecting broker state into each pane. Makes it easy to view live status and attach to agents directly from Herdr.New Features
fleetentrypoint: discovers agents viaagent-relay node agent listin the project cwd (from Herdr context orHERDR_RELAY_PROJECT_DIR), creates a “Relay fleet” workspace, and opens one tab per live agent.pane.report_agentwith 5s polling and change-only updates; mapsidle|working|blocked_on_send|blocked→idle|working|blocked, everything else →unknown(neverdone).agent-relay node agent attach; launches the resident Chief viascripts/chief.sh brain. Attach mode is configurable withHERDR_RELAY_ATTACH_MODE(view|drive|passthrough).fleetandfleet-agent(Linux/macOS); README updated; tests added for picker, attach, mapping, and docs.Bug Fixes
Written for commit 30646ec. Summary will update on new commits.