Repository navigation
Conversation
…s workspaces hc lists every machine's terminals (`vps/t14`) in terminal.list and events.subscribe. groups() took them all, so one labelled with a space only that machine's document has became a workspace of this PC named from its `where` label, and its events reached the server as this PC's. Leave `<machine>/tN` terminals out of the snapshot, the event stream and the pane lookups until hc machines show as PCs of their own. Fixes devswha#2768
|
No actionable comments were generated in the recent review. Summary
Merge Risk:
|
|
Thank you @zerone0x for tracking this down and for a careful fix with tests. The same bug (#2768) was fixed on main by #2795, which landed while this PR was open. It takes the same approach as yours (an address with a Before closing, I ran both of your new tests ( |
Change
Fixes #2768
With
OVIS_RUNTIME=herdr-core, hc lists the terminals of every machine the core holds interminal.listandevents.subscribe(vps/t14after this machine'st7).groups()inserver/herdr-core/snapshot.tstook them all, so a terminal the Herdr app started onvps(labelled with a space onlyvps's document has) fell into the "not placed" branch and became a workspace of this PC named from itswherelabel (ubuntu). Its events reached the server as this PC's pane events too.A
<machine>/tNaddress belongs to that machine, not this PC. Until hc machines show as PCs of their own, they are now left out:snapshot.ts: newonThisMachine(address)(no/in the address);groups()only takes this machine's live terminals, so no workspace, tab or pane is invented for another machine's, whatever its labels or the layout document say.adapter.ts,events.subscribe: hc events about another machine's terminal (created, status, turn, labels, lost, finished, removed, ...) are dropped, and its records in hc's subscribe snapshot are not remembered.adapter.ts, pane lookups:terminal()(send_text, process_info, agent start) andpane.send_keysanswerpane_not_foundfor another machine's address instead of reaching it through hc, aspane.getandpane.readalready do through the snapshot.The pin bridge (
pin-label.ts) is left as it is: it writes no workspace and only acts on panes the server shows.Validation
bun test server/herdr-core/snapshot.test.ts server/herdr-core/adapter.test.ts: 64 pass. The two new tests (a snapshot withvps/...terminals labelled, unlabelled, parented to a local terminal and named in this core's layout; and an adapter test covering the snapshot,pane.get/send_text/send_keysand the event stream) fail on main and pass with this change.bun test scripts/changelog-fold.test.ts: pass.bun run check fast: generated types, generated themes, typecheck, build and actionlint pass; unit tests 11180 pass, 1 fail:server/claude-images.test.ts"a lookup that sees the file rewritten drops the boundary it kept", which has nothing to do with this change and passes when run alone (43/43) both on main and on this branch.bun run check full(needs herdr and Chrome, not available here); no real hc machine pair was available, so the fix was not tried against a livehc machine add.