Repository navigation
chore: target herdr 0.9.3 - #182
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: devswha/herdr-web-ui/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review. 📝 SummarySummary by CodeRabbit
WalkthroughThe protocol schema adds and removes API fields and methods. The type-generation script supports selecting a herdr binary. CI and documentation now reference herdr 0.9.3. ChangesHerdr Protocol Refresh
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Other · Unblocks: 1 PR Merge Risk: ⚪ Minimal · up to This change moves CI and generated protocol types to herdr 0.9.3 with no stated runtime behavior change. No merge-blocking risk was found. Architecture SummaryArchitecture risk: 🔵 Low · up to The change affects 4 systems. Changed systems: Architecture concerns Review detailsSystems and components
Before / after behavior
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
- CI installs checksum-pinned herdr 0.9.3 instead of 0.9.1. - Regenerate the API schema snapshot and wire types from herdr 0.9.3 (protocol 22 unchanged; adds AgentInfo.completion_seq and PaneInfo.restore_error, drops the unused pane.graphics.* types). - generate:types --refresh honors HERDR_WEB_HERDR_BIN, so a schema can be read from a herdr that is not on PATH. - Update docs that name the CI herdr version. min_herdr_version stays 0.9.0. Integration suite passes 131/131 on 0.9.3. Co-Authored-By: Claude Opus 5.5 <[email protected]>
7b32ec5 to
5c64cbf
Compare
> Stacked on #182, which adds `restore_error` to the generated types. Merge #182 first; GitHub then retargets this PR to `main`. ## Summary herdr 0.9.3 sets `PaneInfo.restore_error` when a restart cannot bring a pane back, for example when its saved folder was removed or its shell fails to start. Such a pane has no terminal process. Reproduced on 0.9.3: `pane.read` answers "pane not found" and `herdr terminal attach` exits with "terminal … not found". Until now the web UI showed a terminal that ended immediately. - **Sidebar:** the row shows a **NOT RESTORED** badge (danger tokens) in place of the status badge, with herdr's reason on hover. - **Pane view:** selecting the pane shows "herdr could not restore this pane" and herdr's reason in the terminal area. App passes a null `paneId`, so nothing attaches. - **Server:** `terminalInfoFor` refuses such a pane with `pane_not_restored` and herdr's reason instead of spawning `terminal attach`. An attach can arrive before the client's snapshot does. - Korean, Japanese and Chinese strings. ## Verification - `bun run typecheck`; `bun run test:unit`: 471 pass (including i18n) - `bun run test:integration` against herdr 0.9.3: 131 pass - `bun run test:ui` against herdr 0.9.3: all pass - Browser QA against a real unrestored pane on herdr 0.9.3. Setup: create a pane in a temp folder, stop herdr, delete the folder, restart. Checked: - desktop 1280×800 and phone 390×844: the notice text and the sidebar badge with its hover reason - no pty data or exit for that pane - a healthy pane on the same page still attaches - no page errors - A direct WebSocket `attach` for the unrestored pane gets `{"type":"error","code":"pane_not_restored","message":"Saved directory is unavailable. Restore the directory and restart this session."}`. No automated test covers `pane_not_restored` itself: producing a `restore_error` requires restarting the shared test herdr server mid-suite. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 <[email protected]>
…#183) ## Summary Since herdr 0.9.2, herdr closes an event subscriber that falls behind (`events_lost`). A herdr restart closes every subscription too. Before this PR, only the status stream recovered. The lifecycle and focus streams reconnected after 5 s without reading back what they missed. A pane created during that gap had no status subscription until the 60 s backstop, so its working/blocked events, web push alerts and completion marks were lost. - **Lifecycle and focus streams** reopen right away, backing off from 250 ms to 5 s while herdr is unreachable. The backoff resets once a stream starts. When the lifecycle stream comes back, the collector reconciles from a snapshot and sends `session-changed`. - **Status stream** now follows herdr's documented order: subscribe, wait for `subscription_started`, then snapshot. After the status stream was lost, that snapshot resyncs push baselines through the new `push.resync`: - Only panes with no newer event are updated. - An alert that the new status overtook is called off. - Nothing is announced. - `done` and `idle` both count as at rest, so one never replaces the other. - **Recovery triggers on the close, not the error code.** Against real herdr 0.9.3, a lagging subscriber whose socket buffer was full was closed without the `events_lost` frame ever arriving. - `subscribeEvents` drops frames that belong to a subscription its caller already closed. - The collector takes `subscribe`/`snapshot` and its timings as an injectable seam. New unit tests cover resubscribe, resync, an event racing the snapshot, backoff and reset, the lifecycle restart, and stop during recovery. **Cost:** every time the status subscription is opened, the collector takes one extra `session.snapshot` (herdr's documented order). It converges and does not loop. ## Not addressed (all pre-existing) - A `pane_exited` missed during a gap can't be recovered from a snapshot, so `completions.forget` and `push.onEnded` don't run for it. - A focus event lost during a focus-stream gap stays lost. - Remote-PC panes: their push baselines come from relay snapshots through `push.seed`. The remote bridge only gets this code with the next remote bundle (herdr 0.9.3 bump, planned). - `workspace.close` emitted no `pane_closed` in the smoke test. The 5 s roster poll still covers it. ## Verification - `bun run typecheck`; `bun run test:unit`: 480 pass. The collector suite passed 5 runs in a row. - Mutation checks: disabling the lifecycle restart, the clean-pane filter, the resync gating, the backoff, or the `callOff` in `push.resync` each fails at least one test. - `bun run test:integration` against herdr 0.9.3: 131 pass. - Real-path checks on herdr 0.9.3: - A paused raw subscriber under pane churn was closed by herdr, and no error frame could be read. - A herdr `server stop` followed by a restart, with a pane created in between: the collector subscribed to the new pane and resynced once, about 130 ms after herdr returned. Live split and close events were heard afterwards. CI still pins herdr 0.9.1 until #182 lands. That's fine here: the change works on any herdr version, and these unit tests need no herdr. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
## Change Installed apps are on v0.3.33. Prepare v0.3.34: bump the app and plugin versions together and move the Unreleased notes into the dated release section. The Fixed list is tidied: the duplicated remote-conversation entry is removed, a stray blank line dropped, the wrapping evened out, and the access entry names the two security fixes from #175. This release includes: - **Security:** a device that can only watch could read files on a connected PC through `/api/machines/<id>//fs/file`. Also, alert subscriptions made before any pairing kept receiving alerts after pairing (#175). - Device permissions and durable revocation (#175) - Pane status and push recovery when herdr drops an event stream (herdr 0.9.2+ `events_lost`, and restarts) (#183) - NOT RESTORED marking for panes herdr 0.9.3 could not restore (#184) - Subscription usage accounts told apart, ordered and hidden in Settings (#169) - Draft settlement and delayed-alert fixes (#176), drag copy with a blocked clipboard (#177), remote chat images and full tool output (#174), keyboard after closing a pane from the sidebar (#173) - CI on herdr 0.9.3 (#182), Actions updates (#172), and everything else already in Unreleased since v0.3.33: OmO in the new-session dialog, the website redesign, and the installer installing the latest release ## Validation - `bun scripts/release-notes.ts 0.3.34` passes: package.json, herdr-plugin.toml and a single CHANGELOG heading agree. - The required Fast checks and Integration and browser checks must pass before squash merge. Publish through release.yml after merge; it validates the release commit again before creating the tag. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 <[email protected]>
## Summary This is the last step of the herdr 0.9.3 plan, after #182, #183 and #184. - The remote-PC runtime bundles **herdr 0.9.3** (was 0.9.1). The bundled herdr is only used on PCs that have no herdr of their own; existing installations are preserved. - The SHA-256 of all four platform assets is pinned from the `herdrdev/herdr` v0.9.3 release. The linux-x86_64 value matches the checksum CI already pins in #182. - `REMOTE_BUNDLE_VERSION` goes from 7 to 8, so remote bridges get the server code merged since remote-v7, including the event-stream recovery from #183. ## Release order (docs/remote-pcs.md) Raising the number makes connected bridges ask for **Update bridge…** once. herdr sessions keep running during the update. The order is: 1. merge this PR 2. push the `remote-v8` tag on the merge commit, which lets `remote-bundles.yml` build, smoke-test and publish the four archives and `manifest.json` 3. only then cut an app release that carries version 8 ## Verification - `bun run typecheck`; `bun run test:unit`: 511 pass - `bun run build:remote` (linux-x64, native): herdr 0.9.3 checksum verified. The bundle reports `{"version":"8","herdr":"0.9.3","native_smoke_tested":true}` and the PTY smoke test passes. - `bun scripts/remote-bundle-smoke.ts`: packaged startup, isolated socket and authentication pass - CI builds all four platforms and runs the real SSH job 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 <[email protected]>
Summary
First step of adapting to herdr 0.9.1–0.9.3. No runtime behavior changes.
18a8dc65…4dba7computed from the v0.9.3herdr-linux-x86_64release asset.scripts/herdr-schema.jsonandshared/herdr-api.generated.tsregenerated from herdr 0.9.3 (herdr api schema --json, byte-identical). Protocol is still 22. The generated types gainAgentInfo.completion_seqandPaneInfo.restore_error, both optional. Nothing web-ui calls was removed; the droppedpane.graphics.*definitions were never emitted.generate:types --refreshnow honorsHERDR_WEB_HERDR_BIN, so the schema can be read from a herdr that isn't on PATH.min_herdr_version, the installer gate and the README badges stay at 0.9.0.Remote bundle (still herdr 0.9.1) is intentionally left for a later PR, after the
events_lostcollector fix.Verification
bun run typecheck,bun run generate:types --check,bun run test:unit: 471 passbun run test:integrationagainst herdr 0.9.3 in an isolated session: 131 pass, 0 failherdr terminal attachmeasured on 0.9.0, 0.9.2 and 0.9.3: byte-identical, lone ESC held ~150 ms.TYPED_SETTLE_MS = 300stays.🤖 Generated with Claude Code