Repository navigation
Install compiles nothing: a prebuilt terminal addon, a preflight, and a fresh-install check - #57
Merged
Merged
Conversation
On a clean Ubuntu with herdr, Bun and Node installed as the README says, `herdr plugin install` ended in a page of node-gyp errors and "Plugin was not installed": node-pty has no Linux prebuilds, Bun trusts its install script, and the compile needs Python and a C++ toolchain the README never asked for (and failed here even with them). node-pty now comes as @lydell/node-pty 1.1.0: the same node-pty 1.1.0, repackaged with one prebuilt binary per platform (Linux x64/arm64, macOS, Windows) and no install script. The sidecar keeps pause/resume. - scripts/preflight.sh runs first in the plugin build and says in one line what is missing (bun, node, or a version too old) and that herdr must start from a shell where they are on the PATH, instead of a failed `bun install` some steps later. - build-remote-bundle.ts: every bundle carries only its platform's PTY package; a macOS bundle assembled on Linux fetches that package from the registry, checksum-pinned like the runtimes, and verifies its Mach-O files as before. Host and darwin-arm64 builds and the bundle smoke test pass. - Docs: no compiler or Python needed; Linux x64/arm64 and macOS only, since nothing compiles for other platforms any more. Co-Authored-By: Claude Fable 5.1 <[email protected]>
scripts/fresh-install-docker.ts is the check for "does a new user get a working install": a bare Ubuntu 24.04 with the distro's Node 18 and no toolchain, herdr and Bun from their installers, a headless herdr, `herdr plugin install` of a pushed ref, the start action, /api/health, the PTY smoke test on the box's Node, and the startup hook after a herdr restart, each step timed. Co-Authored-By: Claude Fable 5.1 <[email protected]>
devswha
added a commit
that referenced
this pull request
Nov 21, 2026
… this PC is pressed again (#4412) ## What changed - Show the existing “This PC is in your account” state when the PC’s local binding matches the browser’s sign-in. No add flow or directory write is started for that state. - The “Turn on the relay and add this PC” button follows the same rule: if the PC has since bound, it shows that state without starting the relay. - Re-read local membership after the directory lookup and after a stale-invitation refresh. If the PC has bound in the meantime, show its membership and close the pairing window this attempt opened. - The relay returns a window ID on every link open. Automatic Add cleanup closes only that ID if it is still current, so a newer codeless link stays open. A relist that discovers membership releases its own window even if session storage is blocked. Explicit **Stop waiting** still closes the current window. - Renew stale invitations in place with [ovis-sh/account#57](ovis-sh/account#57 `POST /v1/pcs/:server_id/refresh`. The refresh preserves the listing and its admission; the dashboard uses `invited_at` for the invitation's countdown. - Intentionally omit the raw `acct_…` identifier from the added state. The localized status is the user-facing confirmation. - Leave account PC counts and the account service unchanged. Only an old service that omits the `listing_id` field entirely and answers the refresh request with `404 not_found` uses the legacy DELETE/PUT fallback. A directory row that carries the field with an unusable value (malformed, `null`, a number or empty), fresh or stale, is an invalid answer: nothing is refreshed, deleted or written, and the screen shows its existing "could not be listed, Try again" state (a relist retries later). Otherwise the fallback runs, after a fresh `/api/account/status` read. Its residual race requires a second add to bind the **same PC** after that read and before the DELETE arrives. It closes when #57 is in production: the supported refresh path does not delete or recreate the listing, including when the endpoint returns `409 listing_changed`. An atomic conditional delete for pending listings belongs in the `ovis-sh/account` add-completion follow-up, not in this PR. ## Exported functions and production callers - `AccountService.refreshPc` → `src/lib/account/addThisPc.ts:215` (stale invitation). - `invitationEndsAt` → `src/lib/account/myPcs.ts:33` (fresh invitation classification), `src/lib/relay/dashboard.ts:84` (attention expiry), and `src/components/RelayPcTable.tsx:84` (row countdown). - The existing `listThisPc` reports local membership and hands the window ID only to its opening caller in `src/components/AccountSection.tsx:436` (scheduled/resumed relist) and `:541` (manual/automatic add). The existing `reopenAddWindow` returns the window ID to `:387` (keep the current wait open). ## Verification - Original test-only commit `e6ca1fd3`: three expected reds on main, including the unexpected DELETE and PUT; the stale, locally unbound control passed. - Review-round test-only commit `336c9bc1`: five expected reds on `109330d6`, including two real one-press binds cleared by the next snapshot. The periodic-relist and bound relay-button coverage passed on that head and remains covered. - Review-round fix `884979af`: 306 focused tests passed; repository typecheck passed. - Exact-head `bun scripts/check.ts fast` passed in Docker with `--init`, a private `HOME`, and tmpfs: 21,980 passed, 65 skipped, zero failed. - Offline browser QA: relay shell (including the six-digit Add this PC flow to Ready), relay-panel regression, and all 67 dashboard checks passed; both browser builds succeeded. - Added-state screenshots: English and Korean at 390 and 1440 px, light and dark, under `/home/devswha/.cache/ovis-tmp/relay-hub/trial/relist-captures/` (local evidence). - Window-ownership round: both real-relay-state regressions failed at `884979af` with test-only commit `05d10a84`. At `2f0257db`, typecheck, all 348 focused tests, and the offline relay panel and six-digit Add this PC browser scripts passed. Docker `--init` fast passed with 21,982 tests passed, 65 skipped, and zero failed. - Malformed-listing round (gate finding DIRECTORY-FALLBACK): test-only commit `9dd00797` failed at `2f0257db` on both new cases (`listing_id: "invalid"` and `listing_id: null`, each with a structured `404 not_found` refresh). A scratch probe on that head saw `POST …/refresh`, `DELETE`, `PUT` and a concurrent one-press bind cleared to `null`. Fix `034cf1ee`: `parsePc` keeps a present but unusable ID as `null` (absent stays absent), and `listThisPc` refuses it before any directory write. - Flaky AddThisPc suite: the transient failure came from this PR. `realRelay()` (added in `05d10a84`) starts a real PC whose herdr status reads placed their 10 s timeouts on the suite's fake timer queue, so `getTimerCount() === 0` assertions failed by timing. Under the same load (16 parallel × 2), merge-base main passed 0 failures in 32 runs, `2f0257db` failed 6–14 of 32, and `d4a6eab6` (the file uses `unitHerdrOnly()`, as other server-backed unit files do) passed 32 of 32. - At `d4a6eab6`: all 350 focused tests passed (the earlier 348 plus the 2 new cases); `bun run typecheck` and `git diff --check` passed. Docker `herdr-ci-runner:local` with `--init`, a private `HOME`, tmpfs `/tmp` and an internal network ran `bun scripts/check.ts fast`: every step ok, 21,982 passed, 65 skipped, 0 failed. Offline browser scripts in the same image all exited 0: relay-panel regression; dashboard matrix, 67 checks passed; relay shell QA (Add this PC → six digits → approved → Ready; CSP on 32 pages, no violation; no page errors). - Fresh-row round (gate at `d4a6eab6`): test-only commit `0ffd39f3` failed at `d4a6eab6` for a 1-second-old row carrying `listing_id` `"invalid"`, `17` or `""`: the listing resolved and sent PUT. Fix `e02b8fcb` moves the unusable-ID refusal after the bound-membership return and before the invitation-age check, so any row with an unusable ID rejects with `invalid_answer` and no directory write. At `e02b8fcb`: all 353 focused tests passed (350 plus the 3 new cases); `bun run typecheck` and `git diff --check` passed. Docker fast and browser scripts were not rerun this round; CI covers them. --------- Co-authored-by: sisyphus-dev-ai <[email protected]>
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.
What a new user saw
On a clean Ubuntu 24.04 with herdr, Bun and Node 18 installed exactly as the README says,
herdr plugin install devswha/herdr-web-ui --yesended after six seconds in a page ofgyp ERR!lines and "Plugin was not installed." node-pty has no Linux prebuilds, Bun trusts its install script, and the compile wants Python and a C++ toolchain the README never asked for. With Python, make and g++ added it still failed (configure error), so the toolchain route was fragile too.The fix
@lydell/node-pty1.1.0 replacesnode-pty: the same node-pty 1.1.0 code, repackaged with one prebuilt N-API binary per platform (Linux x64/arm64, macOS x64/arm64, Windows) as optional dependencies and no install script. Pinned exactly, since that package'slatestis a 1.2 beta. The sidecar keepspause()/resume(); a probe under Node 18 and Node 26 shows a paused pty delivers nothing until resumed.scripts/preflight.shruns first in the plugin's[[build]]: bun and node present and new enough, else one plain line saying what to install and that herdr must start from a shell where they are on the PATH. The startup hook runs with that same PATH, and its failure is silent by herdr's design, so build time is the moment to say it.pty.node, plusspawn-helperon macOS); a macOS bundle assembled on Linux fetches that package from the npm registry, checksum-pinned like the runtimes.bun run build:remotefor the host and fordarwin-arm64andscripts/remote-bundle-smoke.tspass.REMOTE_BUNDLE_VERSIONis unchanged; existing bundles keep working.scripts/fresh-install-docker.ts: the repeatable version of the check above (Docker), documented in docs/development.md.Verified
Fresh Ubuntu 24.04 container, Node 18, no Python/make/g++, non-root user, terminal-like shell (
bash -li), herdr 0.9.1 and Bun 1.4.2 from their installers, headlessherdr server:herdr plugin install … --yes/api/healthokIn that install,
bun test server/output.contract.test.ts(real attaches through the sidecar, pause at the high watermark, ACK resume, Ctrl+C while paused) passes: 5/5 (the test's output producer needspython3, so it was added for the test only). Locally: typecheck, build,bun test server/pty/session.test.ts server/output.contract.test.ts.Known, pre-existing and unrelated to this change:
session.test.ts's "stops output reads while keeping Ctrl+C input live" fails whennodeon the PATH is 18 (the test's ownnode -echild behaves differently on 18; it passes on 26), with the compiled node-pty as well. The real flow-control contract on Node 18 passes, as above.🤖 Generated with Claude Code