Repository navigation
feat(machines): mirror a pane's screen into the terminal lens where herdr cannot attach - #228
Merged
Merged
Conversation
…rdr can attach there
…d tell a reused pid from herdr's A PC without terminal attach sent each WS input straight to pane.send_text, so a Stop tapped right after Send could land between the message and its Enter. It now waits its turn in the pane's queue like every other input. herdr's Windows socket marker was called live whenever its pid was: after a reboot another program can hold that pid, and the bridge then refused to start a daemon. What runs under the pid decides (tasklist), with the pid alone as the fallback. The bundle smoke no longer replaces a failed assertion with its cleanup error.
…erdr cannot attach herdr has no terminal attach on Windows (herdrdev/herdr#4821), so such a PC had a chat lens and a notice in place of its terminal. The bridge now reads the pane's visible screen (pane.read, ansi) a few times a second and sends each changed screen as a whole repaint in ordinary pty-data frames. MirrorSession stands where PtySession stands, so the attach lifecycle, the replay for late joiners and the output window are unchanged. The grid is the pane's own: pane-geometry carries fixed, sent before the first screen, and every client adopts it instead of resizing. Typing goes through pane.send_text in the pane's queue. /api/health and the PC list carry terminal_mirror. A stopgap: no cursor, nothing between two reads, and it ends once herdr reports attach.
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configurationConfiguration used: Repository: devswha/herdr-web-ui/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (13)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
… and drop it with its connection Typing on a server that did not know yet whether herdr attaches waited for the ping outside the pane's queue, so a message sent meanwhile overtook it. The turn is taken first and the probe runs inside it. Typing that waited its turn was still sent after its connection closed. It is dropped.
# Conflicts: # server/index.ts
…on Windows cmd holds the file it redirects into. A PC that already ran a bridge for one herdr session could not start a second: the launcher's redirect into the shared bridge.log failed with "being used by another process" and the bridge never ran (found on a real Windows PC with a default-session bridge up and a named session added). The log and the launcher are named after the session, and so is the daemon's log.
…setup - PowerShell ends a single-quoted literal at a curly quote (U+2018 to U+201B) too: a path holding one ran what followed it. psQuote doubles them, and remote-entry.ts uses the same function. - The win32 bundle carried node_modules/.bin symlinks, which an account without the symlink privilege cannot extract. - The bridge launcher was written as ASCII, so a profile such as C:\Users\홍길동 lost its name and Bun never started. It is UTF-8 now, behind chcp 65001. - A key file whose last line had no newline took the app key onto that line. - The administrators key file kept a write grant to Users, Authenticated Users or Everyone that it already had, and sshd refuses such a file. - A marker whose pid another herdr holds was called live. Its second field is the daemon's start in Unix nanoseconds, compared now with the process's creation time, and the name has to be herdr exactly. All six were reproduced on a real Windows PC before the fix.
# Conflicts: # CHANGELOG.md
… size, and end an attach to a mirror already gone From an adversarial review of the mirror: - A late joiner got the stream tail of the last frame, which cuts a screen larger than the replay buffer in two. The mirror hands over its latest screen whole. - A pane resized on its PC kept its old grid here: no event this server listens to announces a layout change. The mirror asks for the pane's size every two seconds, tells the clients first, then paints the screen again. - An attach that waited for a mirror whose pane vanished during its first read joined a record already closed and heard nothing more. It gets pty-exit.
…-mirror # Conflicts: # CHANGELOG.md # docs/remote-pcs.md # scripts/windows-host-qa.ts # scripts/windows-lens-browser-qa.ts # server/herdr/client.ts # server/index.ts # server/submit.contract.test.ts # shared/machines.ts # shared/protocol.ts # src/App.tsx # src/components/PaneTerminal.tsx
devswha
added a commit
that referenced
this pull request
Oct 1, 2026
Release v0.3.38: moves the Unreleased notes under 0.3.38 and bumps `package.json` and `herdr-plugin.toml`. In this release: Windows PCs over SSH (#227) with an interim mirrored terminal (#228), sidebar workspace folding (#222), Gajae Code in New session (#220), gjc background results ending a chat turn (#225), OmO pane marks without an agent kind (#224 by @beomq). The mirror entry now says that a phone cannot pan the pane-sized grid yet (#230). Remote bundle `remote-v9` is tagged on `79abf6c`; `release.yml` runs only after its release is published. `bun scripts/release-notes.ts 0.3.38` prints the notes and exits 0.
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.
Stacked on #227. Refs #189.
Why
herdr has no
terminal attachon Windows yet (herdrdev/herdr#4821), so #227 gives a Windows PC a chat lens and a notice where its terminal would be. This is a stopgap so the terminal lens shows something real until herdr can attach there.What
server/mirror.ts:MirrorSessionreads the pane's visible screen (pane.read, ansi) every 80 ms while it changes, relaxing to 400 ms, and sends each changed screen as one whole repaint in ordinarypty-dataframes. It hasPtySession's surface, so the attach lifecycle, the replay for late joiners (the latest screen only) and the output window are reused as they are.pane-geometrygainsfixed: true, sent before the first screen; every client adopts that size and none resizes. A layout change on the PC re-reads the size and repaints.pane.send_textin the pane's queue.HerdrIdentity.terminal_mirroron/api/health,/api/bridgeand the PC list. The client treats it as a working terminal lens: no soon pill, and the lens remembers its choice per pane again. Theterminal_unsupportedhandling stays for a bridge without the mirror.createServer({ terminalAttach: false })(from feat(machines): Windows PCs over SSH, chat lens only until herdr can attach there #227) answers as a Windows herdr would, for tests and QA.Limits
scripts/windows-host-qa.tsis updated for the mirror but was not run.Tests
server/mirror.test.ts: frame shape, sends only changed screens, pause/resume sends the latest only, repaint, kill stops reading, ends when herdr says the pane is gone.server/submit.contract.test.ts: over a real pane with attach forced off: the pane's grid arrives before the first screen, a resize is ignored, typedechooutput comes back as a screen, a late joiner gets the current screen, closing the pane ends withpty-exit.scripts/windows-lens-browser-qa.ts: in Chrome, the terminal lens shows typed output and colour, survives a lens switch, and a phone-sized second viewer sees the same screen.bun run typecheck,generate:types --check,test:unit(647 pass),test:integrationpass locally.