Repository navigation
Replace a pane-exported HERDR_BIN_PATH with the bundled herdr in the packaged app - #242
Merged
Merged
Conversation
…packaged app A packaged app opened from a Herdr pane inherited the HERDR_BIN_PATH Herdr exports into every pane. That path dies when the bundle that started the server is replaced, so hide connect refused it as start_failed on every attempt and the window never attached. An inherited HERDR_BIN_PATH is now an explicit override only when it arrives without HERDR_PANE_ID. With HERDR_PANE_ID it is Herdr's own export, and the packaged host hands its bundled herdr to every hide child instead, recording the replaced path as replaced_pane_herdr on discovery.start. An unpackaged host still passes whatever it inherited.
…ement only when the value differed The install guide, the agent notes and the env registry comment still described the old pass-through rule; the packaged app now replaces a pane value, while the hide CLI run in a pane and an unpackaged host still inherit it. A pane value that already names the bundled herdr is no longer recorded as replaced.
git commit starts a detached git maintenance run --auto, which can pack and prune the fixture's loose objects while the next git clone --bare is still copying them, failing a random clone test with "failed to copy file to ...: No such file or directory" on the hosted macOS runner. The fixture's git calls now turn auto maintenance and auto gc off.
yansfil
added a commit
that referenced
this pull request
Sep 28, 2026
…one test fixtures (#245) Related: 2a8e6d1 is on `feat/overview-lenses` (#238); the maintenance guard was found while working on #242. This lands both on `main`. ## Summary - The clone test fixtures (`hide-host/tests/clone.rs`, `herdr-core/src/runtime/tests/repository_clone.rs`) commit, then run a local `git clone --bare`. - `git commit` starts a detached `git maintenance run --auto`, which can pack and prune loose objects while the clone is still copying them. - On macOS CI runners this fails a random clone test with "failed to copy file ... No such file or directory" in the fixture, before the code under test runs. - Tonight it failed the `rust workspace` lane of #242 (twice), #243 and #244, always at `clone.rs:24`. - The fixtures' `git` calls now turn off auto maintenance and auto gc, and the bare origin is cloned with `--no-local` (a pack through Git's transport, no file copy). Test-only. ## Review - **Please decide**: whether landing this on `main` before #238 is fine; 2a8e6d1 is identical to the commit on `feat/overview-lenses`, so #238 merges over it cleanly. - **Files to watch**: `herdr-core/src/runtime/tests/repository_clone.rs` - preventive: the same fixture shape, not observed failing. ## Evidence - **Confirmed**: `cargo test -p hide-host --test clone` passes 5/5 locally; the hide-host race reproduced locally under forced background gc before the maintenance guard and not after (measured while working on #242). - **Not confirmed**: the flake rate on CI after the change beyond this PR's own runs; the herdr-core fixture never reproduced. **AI tooling**: mostly AI tools; the diff is three cherry-picked commits, compared by hand.
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.
Summary
Closes #214
A packaged app opened from a Herdr pane (
open /Applications/hide.app) inherited theHERDR_BIN_PATHHerdr exports into every pane.That path dies when the bundle that started the server is replaced, so
hide connectrefused it asstart_failedon every attempt and the window never attached.The packaged host now treats an inherited
HERDR_BIN_PATHas an explicit override only when it arrives withoutHERDR_PANE_ID.With
HERDR_PANE_IDit is Herdr's own export, and the host hands its bundledherdrto everyhidechild instead, logging the replaced path asreplaced_pane_herdr.An unpackaged host still passes whatever it inherited; the rule lives in
desktop/src/main/herdr.tsanddocs/ARCHITECTURE.md(The desktop host).Same launch, same stale pane environment (
HERDR_PANE_IDset,HERDR_BIN_PATHnaming a missingherdr-runtime/herdr). Before: "hided could not start". After: attached, and the fixture pane's terminal attaches through the bundled herdr.Review
HERDR_BIN_PATH=/x open hide.apptyped inside a pane cannot be told apart from Herdr's export and is replaced too (documented).desktop/src/main/host.ts- failure path:childEnvironmentspreads the chosen herdr after the inherited env, so the replacement wins.desktop/src/main/env.ts- the env registry now readsHERDR_PANE_ID(presence only).HERDR_SOCKET_PATH, pane/tab/workspace ids,HERDR_ENV) still reachhideand the daemon; none blocks attach. Worth a follow-up issue?Evidence
chooseHerdrunit tests, one per branch (bundled, override, pane replaced, pane already bundled, unpackaged); desktop 48/48.@electron/packager, launched with a staleHERDR_BIN_PATH+HERDR_PANE_IDagainst a private Herdr server.herdr:"inherited", thendiscovery.failed start_failed.herdr:"bundled",replaced_pane_herdrset,discovery.attached, coreterminal.session_readyfor the pane.scripts/verify-web.shpasses (hcoord, web and desktop typecheck/lint/test/build); identity and attribution checks pass.pnpm --dir desktop e2e: 18 passed, 1 skipped, 1 failed.browser.spec.ts:465(zoom of a focused page) fails on this unattended machine. It fails the same way withorigin/main's desktop source, and e2e runs unpackaged, where herdr resolution is unchanged./Applications/hide.appwas not replaced or relaunched (operator's copy); no release build was made.AI tooling: Mostly AI tooling; the rule was checked against the before/after launch logs and screenshots of a real packaged build.