feat(macrod): ratatui control panel serving in-process - #6031
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Team Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
bc396af to
4eea58d
Compare
4eea58d to
b1270bc
Compare
2921189 to
f3108db
Compare
f3108db to
83eb0e1
Compare
83eb0e1 to
07fedf4
Compare
07fedf4 to
015db81
Compare
015db81 to
0154d60
Compare
0154d60 to
ccde028
Compare
ccde028 to
4a75e17
Compare
4a75e17 to
f6e63f2
Compare
2c63bdb to
5a7f650
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 5a7f650. Configure here.
| .context(format!( | ||
| "failed to bind the webhook server to port {port} - is another macrod \ | ||
| (a separate `macrod` serve, or another tui) already running?" | ||
| ))?; |
There was a problem hiding this comment.
Reconcile task leaks on start failure
High Severity
Daemon::start spawns the feed reconcile loop before binding the webhook port, and a bind failure returns without calling cancel(). Dropping a CancellationToken does not cancel it, so the loop keeps reconciling feeds for the rest of the TUI process. Re-pairing then leaves that leftover loop maintaining the previous harness's feed against a listener that is not running.
Reviewed by Cursor Bugbot for commit 5a7f650. Configure here.
5a7f650 to
a45b6e4
Compare
`macrod tui` runs the serving core inside a terminal UI: overview of the registration and bound agents, live session table, comment-preserving config editing, pairing (browser auto-open, copyable code) with the daemon restarted on the new credential, self-retirement, and a log tab. Backed by new HarnessOnly self endpoints (GET/DELETE /harnesses/me, /harnesses/me/sessions).
a45b6e4 to
4b4f095
Compare


Adds
macrod tui: the serving core runs inside a terminal control panel with pairing, live sessions, comment-preserving config editing, self-retirement, and logs, backed by new HarnessOnly self endpoints. Stacked on #6030.Note
Medium Risk
Changes touch harness authentication, session ownership, and cross-harness isolation on control APIs; incorrect binding logic could block legitimate daemons or leave a gap, though tests cover the new harness owner and serve-session checks.
Overview
macrodis now a single terminal control panel that runs the webhook/feed-reconcile serving core in-process (no separateloginsubcommand). The UI shows harness registration, bound agents, live sessions, comment-preservingmacro.tomlediting, in-panel pairing (p), self-removal, and ring-buffer logs; pairing and registration errors point users to re-pair in the TUI instead ofmacrod login.Storage adds harness-authenticated self endpoints for the daemon:
GET/DELETE /harnesses/me, plusGET /harnesses/me/sessions(recent sessions for bots bound to that harness, backed by a new SQLx query). OpenAPI/Orval/Zod clients pick upHarnessSessionand the new routes.Harness session authorization is tightened. Session create for harness callers always uses the verified acting user (forwarded header), not an unverified
ownerin the body; the daemon sends that header when opening sessions from mentions. Control, delete, and sandbox resize require harness callers to matchsession_harness(bot bound to their harness) so one harness cannot drive another user’s sessions on a different machine. Runtime registry exposesbound_harnessfor that resolution.Webhook verification rejects empty signing secrets so a daemon with no feed secret cannot accept forged deliveries after the feed is cleared.
Reviewed by Cursor Bugbot for commit 4b4f095. Bugbot is set up for automated code reviews on this repo. Configure here.