feat(daemon): place herdr-app views in herdr-core for a window on another machine #3956
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #3956"
general
weight: 0.35
mvschwarz
Refs #3756
What this does
rig terminal open <view> --provider herdr-appon a machine with no herdr-app window used to fail withherdr_app_unavailable("herdr-app has to run on the machine the daemon runs on"). That's the headless-box setup in #3756, where the daemon and seats run on a server and herdr-app runs on another machine connected to that server's herdr-core.Now, when nothing answers at the app home's socket and this machine's herdr-core does, the view is placed in that core:
herdr.space=openrig-<view id>andherdr.tab=openrig-<cell>, which any connected herdr-app adopts. Each tab shows its seat's label: a viewer's command leads with it, and herdr names an unnamed tab after its program. The viewers start in a per-view folder,$OPENRIG_HOME/private/herdr-app/spaces/<view name>-<view id>, which herdr names the space after; a rig's view is named after the rig.rig.json.okandopenedmean the viewers started, and the newplacementfield is{ mode: "core", visibility: "unconfirmed", core, viewId, host }. The CLI prints "Placed in herdr-core on <host> as view <id>. Any herdr-app connected to <host> shows it; OpenRig can't see that window."rig terminal close <rv-id>ends the view's verified viewers directly (journal,openrig.labels and exact argv, as today). Seats are never touched.placement: "core"and never written into the Rig layout. A restart with both kinds rebuildsrig.jsonfrom layout views only.status()reportsavailable: truewithplacement: "core"andhostonly while no window is here and the core answers.rig terminal openis unchanged:- in a herdr-app terminal whose window doesn't answer, it still falls back to a desktop window, because core placement doesn't count as a window here;
- an omitted provider never picks herdr-app.
docs/reference/herdr-app.mdgains "A herdr-app on another machine", with these limits:Tests
On macOS, against fakes of
hcand the app, plus real tmux for the viewer wrapper:herdr-app-provider.test.ts: 52/52. New cases cover:- the core open (labels, distinct tab ids, the per-view folder, the immediate writable tile with the size watch, no layout write or mods);
- status;
- close with no window;
- an ended viewer and a viewer replaced by a shell (reported once, never ended, named on close);
- rollback;
- mixed layout and core views across a restart;
- the startup report, and the running daemon's report when it notices a shell;
- tab labels and a rig view's space name.
herdr-app-viewer-size.test.ts, real tmux 3.6a: a core viewer attaches at once with no gate. At the headless size it leaves the person's window size alone, and once shown and typed in it sizes the seat.terminal-herdr-app.test.tsand the other CLI terminal tests: 135/135. They cover the ambient fallback with core placement and the result line.open-window-herdr-app.test.ts,open-window.test.ts,terminal-journey.test.tsandorganizer.test.ts: all passed, with 9 skipped. They cover the core target, the preview text with Open kept, and the result notice.- the core close path;
- the layout filter;
- the shell check;
- the core pending end;
- the size watch;
- the CLI's ambient check.
Checked on real builds
On herdr-app 0.1.18 (Linux, a virtual display) connected to a separate Linux account's herdr-core 0.1.22 over ssh to 127.0.0.1, with OpenRig built from this branch. These passed:
That run found two problems, fixed here:
Not run
create-terminal.integrationandterminal-pipe-utf8tests, which need a builtdist.Round 2: CodeRabbit's two points on
closeViewBoth were real, and both came from one gap: a core view's close counted only the viewers the journal already marked as shells.
- The trade: a folder kept for a viewer that ends later stays behind as an empty folder under
spaces/, and nothing removes it afterwards.Tests:
herdr-app-provider.test.ts: 54/54, with two new cases: a shell since the last check, and a viewer the close couldn't end. On2b00a20c's source, both fail on the note, and checked separately, on the folder.herdr-app-provider,herdr-follow-view,herdr-live-reuse,herdr-app-viewer-gateandherdr-tile-resume): 147/147.🤖 Generated with Claude Code
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->
Summary by CodeRabbit
New Features
Views can open in herdr-core when no herdr-app window is available on the daemon’s machine, with labeled tabs for each view.
Open results and status previews report core placement and its host, and indicate that visibility is unconfirmed.
When no local window is available, status guidance now includes how to list terminals on the daemon’s machine.
Ambient herdr-app targeting falls back to a desktop window when core placement is reported.
Documentation
Clarified placement conditions, input timing, status reporting, closing behavior, and visibility limitations.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->