Repository navigation
feat: move a Herdr session into Hide's own engine behind the switch - #2049
Merged
Merged
Conversation
Read Herdr's session.json in every form Herdr v0.9.5 reads, keep Herdr's public workspace, tab and pane ids, map the split directions, and leave out only a workspace that does not hold together, with its reason. Fixtures are sessions Herdr 0.9.5, 0.9.1 and 0.8.2 wrote.
On the core's own engine nothing but Hide's integration names a pane's session. Grok's and Cursor's session start hook now reports the session its input names, and Pi's, omp's and OpenCode's scripts ask the helper's new session operation at a session start or switch, so letters and the inbox reach the agent before its first turn. The Pi, omp and OpenCode plugin e2e specs run on both engines.
One record per machine's engine folder holds the Herdr save's workspaces not moved yet, those moved, the conversations waiting to resume, the move asked for, the commit mark and the last outcome. The local cleanup leaves the state of the workspaces not moved alone, and only drops what the engine made itself while the save cannot be read.
The save stamp is a u64 so the internally tagged record reads back; the engine test expects its new workspace numbered apart from gathered Herdr ones; the Pi, omp and OpenCode tests and pinned bytes follow the session report, and the record hands a moved pane's Herdr terminal to its pane id.
… resume it once Herdr stops
…e glossary's word
The core looks at a device's Herdr save through its node before the device's engine opens, offers it under the device's id, and stops Hide's Herdr there through the node. A move is committed with the save the node read kept in the device's engine folder, and the core's next start imports it before any link is up, keeping the device id as its registrations' scope.
The stop's wait is passed in so a test ends a real child of the test binary in under a second, and a server that ended between the look and the system's end reads as gone rather than refused.
…busy A conversation an import gave back once its Herdr stopped used to wait for the next import when its pane ran another command. It now resumes in a new tab of the same workspace after the restore, and waits again only when that tab cannot open.
… back After this machine's Herdr session moved, a failed core update already refused to start the previous build; it now also points current at the new build, so a retry starts that build again. The update's starter is passed in so both ends are tested without the account's login item.
…o feat/engine-b4-transition
A look, a move and the engine's restore changed the record from their own threads under two separate locks, and the restore under none, so one could write over a waiting conversation another had added. Every change now reads, changes and writes the record under one lock in herdr_import.
… stopped The move reads Hide's Herdr on the socket HERDR_SOCKET_PATH names, where its registrations were made. A start whose asked resume finds a Herdr on the socket again imports its conversations waiting, and a device's resume follows the save read after its stop. A read-only import of a save Hide never used commits nothing, so a failed update may still go back, and a place that cannot be read is logged.
Windows names no process's program file, so Hide's Herdr there read as another's and was never moved or stopped. The server now counts as Hide's when it runs one of Hide's Herdr files where they are. A save whose last change cannot be read is unreadable rather than stamped as never changed.
yansfil
marked this pull request as ready for review
November 3, 2026 23:57
…rt record among the core's stores
…ine in the Pi and omp stand-in A core on Herdr also holds an engine handle, so the takeover is left out only when that handle is the core's own engine. The Pi and omp stand-in reads the pane from HIDE_PANE_ID, which a pane on the own engine carries, and asks Herdr only when the fixture runs it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related: #2017 (two-engine gate, merged)
Summary
On a machine that switches to Hide's own engine (still behind the development switch
HIDE_DEV_PANE_HOLDER=1), Hide's Herdr session moves over: the same tabs, layout and ids, and the agents reopen their conversations.While Hide's Herdr runs, Hide asks first; "Later" leaves a sidebar row, and a Herdr Hide never used can be imported read only from the row, Settings, the first run or
hide import herdr.A dialed device asks the same question under its name, and its node reads its save and stops Hide's Herdr there with the code this machine uses.
An agent whose turn the move or a reboot cut off gets one letter after it resumes; a resting agent gets none.
Pi, omp, OpenCode and Grok report their first session when the shell starts or the session switches, so letters reach them before their first turn.
The Herdr path is unchanged.
Review
server.stop(D-6 named the program'sherdr server stop): the same API, it still works after an update removed the program (B42), and the end is confirmed by pid and start time, falling back to the system's end; a device's node stops its Herdr with the same code.its tab 2 does not lay out exactly the panes it holds) in every language.herdr-core/src/herdr_import.rs- the record that holds not-yet-moved panes' Hide state, the commit mark, waiting resumes.hided/src/herdr_transition.rs- which Herdr is Hide's (peer pid, start time, program), stop and its fallback, the core-role restart.herdr-core/src/herdr_import/device.rs,hide-host/src/herdr_save.rs- a device's move: the node reads and stops (Call::HerdrSave,Call::HerdrStop, refused unless the server is still the one found), the save it read is kept in the device's engine folder, and the next start imports it before any link is up.docs/INSTALL.mdgains a support row for the move, unverified on all three systems until the new-engine journey moves a live Herdr; a Windows device runs no node, as the dialed device row already says.hided/src/core_update.rs- after a commit, a failed core update does not start the previous build and keepscurrentat the new one, so a retry starts it again (B40).herdr-core/src/engine/own/restore.rs- reads hook files on the restore thread, gives waiting conversations back to their panes.hided/src/pane_auth.rs- refuseshidefrom a Herdr pane not moved yet (pane_not_moved) before the checkout fallback.herdr.exeor a pinned device copy, matched by file identity; a Herdr Hide started from a copy that was renamed reads as someone else's and is only offered read only (thedocs/INSTALL.mdcell says so).herdr-core/src/herdr_import.rs- every change to the import record takes one lock in the record's owner, so the core, the start and a device's move never overwrite each other; the move is marked done (commit) only before a step that cannot be undone, never for a read-only import.hided/src/herdr_transition.rs- an asked move reopens conversations only if Hide's Herdr is still stopped at the next start; one started again keeps them waiting and logs why; the move reads the Herdr socket a shell named while the own engine is on.scripts/check-core-touches-no-machine.pynow listsherdr-core/src/herdr_import.rsamong the core's own stores (10 touches): the import record beside the engine's saved layout (D-25), the save a device's node read, kept there until the next start imports it, and the delivery ledger whose registrations the move hands over before the core runs. The module stays after Herdr goes (the PRD names it among the three remaining pieces), so it is a store and not a later layer. The core now names the save's wire types and read cap fromhide_node_link::herdr_saveinstead of node code.Evidence
scripts/verify-cargo.sh lintandscripts/verify-cargo.sh test --no-fail-fast: 7528 passed, 0 failed, 170 ignored.import-*states render,import-deviceamong them.Verification record