Skip to content

feat(macrod): ratatui control panel serving in-process - #6031

Merged
ehayes2000 merged 1 commit into
eric.hayes/macrod-harness-registrationfrom
eric.hayes/macrod-tui
Sep 1, 2026
Merged

feat(macrod): ratatui control panel serving in-process#6031
ehayes2000 merged 1 commit into
eric.hayes/macrod-harness-registrationfrom
eric.hayes/macrod-tui

Conversation

@ehayes2000

@ehayes2000 ehayes2000 commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

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
macrod is now a single terminal control panel that runs the webhook/feed-reconcile serving core in-process (no separate login subcommand). The UI shows harness registration, bound agents, live sessions, comment-preserving macro.toml editing, in-panel pairing (p), self-removal, and ring-buffer logs; pairing and registration errors point users to re-pair in the TUI instead of macrod login.

Storage adds harness-authenticated self endpoints for the daemon: GET/DELETE /harnesses/me, plus GET /harnesses/me/sessions (recent sessions for bots bound to that harness, backed by a new SQLx query). OpenAPI/Orval/Zod clients pick up HarnessSession and the new routes.

Harness session authorization is tightened. Session create for harness callers always uses the verified acting user (forwarded header), not an unverified owner in the body; the daemon sends that header when opening sessions from mentions. Control, delete, and sandbox resize require harness callers to match session_harness (bot bound to their harness) so one harness cannot drive another user’s sessions on a different machine. Runtime registry exposes bound_harness for 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.

@coderabbitai

coderabbitai Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: 6873a509-2b1c-462f-82f9-24313cc6a63b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Aug 28, 2026

Copy link
Copy Markdown

Comment thread crates/coding_agent_worker/src/daemon.rs
Comment thread crates/coding_agent_worker/src/daemon.rs
Comment thread crates/coding_agent_worker/src/tui.rs
Comment thread crates/coding_agent_worker/src/main.rs Outdated
Comment thread crates/harnesses/src/outbound/pg_harness_repo.rs
@ehayes2000
ehayes2000 force-pushed the eric.hayes/macrod-tui branch from bc396af to 4eea58d Compare August 31, 2026 16:34
Comment thread crates/coding_agent_worker/src/daemon.rs
Comment thread crates/coding_agent_worker/src/tui.rs
@ehayes2000
ehayes2000 force-pushed the eric.hayes/macrod-tui branch from 4eea58d to b1270bc Compare August 31, 2026 18:56
@ehayes2000
ehayes2000 force-pushed the eric.hayes/macrod-tui branch 2 times, most recently from 2921189 to f3108db Compare August 31, 2026 20:00
Comment thread crates/coding_agent_worker/src/daemon.rs
Comment thread crates/coding_agent_worker/src/daemon.rs
Comment thread crates/coding_agent_worker/src/tui.rs
@ehayes2000
ehayes2000 force-pushed the eric.hayes/macrod-tui branch from f3108db to 83eb0e1 Compare August 31, 2026 20:21
@ehayes2000
ehayes2000 force-pushed the eric.hayes/macrod-tui branch from 83eb0e1 to 07fedf4 Compare August 31, 2026 20:35
Comment thread crates/coding_agent_worker/src/tui.rs
@ehayes2000
ehayes2000 force-pushed the eric.hayes/macrod-tui branch from 07fedf4 to 015db81 Compare August 31, 2026 21:20
@ehayes2000
ehayes2000 force-pushed the eric.hayes/macrod-tui branch from 015db81 to 0154d60 Compare August 31, 2026 22:45
Comment thread crates/agent_session/src/inbound/axum_router.rs
@ehayes2000
ehayes2000 force-pushed the eric.hayes/macrod-tui branch from 4a75e17 to f6e63f2 Compare September 1, 2026 15:05
@ehayes2000
ehayes2000 force-pushed the eric.hayes/macrod-tui branch 2 times, most recently from 2c63bdb to 5a7f650 Compare September 1, 2026 15:46

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ 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?"
))?;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 5a7f650. Configure here.

@ehayes2000
ehayes2000 force-pushed the eric.hayes/macrod-tui branch from 5a7f650 to a45b6e4 Compare September 1, 2026 16:16
`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).
@ehayes2000
ehayes2000 force-pushed the eric.hayes/macrod-tui branch from a45b6e4 to 4b4f095 Compare September 1, 2026 16:49
@ehayes2000
ehayes2000 merged commit 0284a5c into main Sep 1, 2026
41 of 64 checks passed
@ehayes2000
ehayes2000 deleted the eric.hayes/macrod-tui branch September 1, 2026 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant