feat(agentos): add inspector Terminal tab with server-side shell replay - #1895
Merged
Conversation
agentOS runs Linux-only, so the engine, sidecar, and VMs live in a container while the working tree stays on the host. node_modules, the cargo target, and the toolchain build trees are container-owned volumes so host edits are visible without dragging darwin-native binaries into Linux.
…tem tab
- Buffer ReadableStream request bodies and strip `duplex`. Chrome
requires HTTP/2 for request streaming, so every action POST failed
with ERR_ALPN_NEGOTIATION_FAILED over cleartext HTTP/1.1.
- Attach by actor id via `getForId(...).connect()`. The previous
`useActor({name, id})` call passed a field that does not exist behind
a type-suppressing cast, so no tab received live events.
- Normalize omitted `args` in the process tree, which threw on render.
- Give the VM state chip the bordered pill treatment its neighbours use.
Interactive PTY shells in the dashboard, rendered with Ghostty's VT parser. Input is raw passthrough: the kernel's line discipline owns echo, editing, and signal generation. Shell enumeration is server-owned. A shell outlives the page that opened it and holds the VM awake, so a client that lost its page must still be able to find it; `listShells` replaces any client-side tracking. The actor also keeps a headless emulator per shell, fed the same chunks it broadcasts, and serializes it back to ANSI on demand. Without it a reattaching client sees a blank pane until the guest repaints, which a full-screen program never does unprompted. Every broadcast carries a sequence number matching the snapshot's, so a client applies the repaint and then only the chunks past it. Also fixes `health.booted`, which was permanently false: racing a settled promise against an immediate value always loses, because `.catch()` still schedules a microtask.
|
🚅 Deployed to the agentos-pr-1895 environment in agentos
|
jog1t
force-pushed
the
feat/agentos-inspector-terminal-tab
branch
from
August 5, 2026 23:07
2bb2f11 to
2291145
Compare
jog1t
force-pushed
the
feat/agentos-inspector-terminal-tab
branch
from
August 5, 2026 23:08
2291145 to
fc70d78
Compare
Remove the globalThis.fetch override (fetch-compat.ts) that buffered ReadableStream request bodies for HTTP/1.1 compatibility. Export ShellSnapshot and ShellReplayMode from the package index so downstream consumers (agentos-apps) can name them in generated declarations.
jog1t
force-pushed
the
feat/agentos-inspector-terminal-tab
branch
from
August 5, 2026 23:09
fc70d78 to
2b75cce
Compare
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.
Adds a Terminal tab to the agentOS dashboard inspector, plus the server-side state a reattaching client needs to be repainted.
Terminal tab
ghostty-web), multi-shell strip, close, resize.listShells). A shell outlives the page that opened it and holds the VM awake, so it has to stay discoverable from a fresh page.Shell replay
shellSnapshotaction. Without it, a reattaching client sees a blank pane until the guest repaints — which a full-screen program never does unprompted.none | screen | scrollback; all three implemented. Restores colors, attributes, cursor, alternate screen, and DEC modes (read back individually, so the exact mouse protocol and bracketed-paste state survive).shellDatabroadcast carries a sequence number matching the snapshot's, so a client applies the repaint and then only the chunks past it — no gap, no double-render.Pre-existing fixes this depends on
duplex: "half"made every inspector action fail withERR_ALPN_NEGOTIATION_FAILEDover cleartext HTTP/1.1.useActor({name, id})passed a field that does not exist, behind a type-suppressing cast; no tab received broadcasts.health.booted— permanently false; racing a settled promise against an immediate value always loses.Tests
tests/shell-replay.test.ts(11 tests), including a fixed-point round-trip: replaying a snapshot into a fresh emulator must reproduce it byte-for-byte. One test covers a cross-shell content leak found during verification — a recycled emulator handle carried the previous shell's screen and served it to whoever attached next.Verified live in the dashboard: real keyboard input, tab-switch and hard-reload repaint, alternate-screen fidelity, multi-shell isolation, clean close, no console errors.
Notes
ghostty-webmoves to a runtime dependency; the actor imports it. It stays external in the bundle, so the wasm is not inlined.@agentos-software/vimdeclares avimcommand but ships no executable — confirmed against the published npm artifact in a live VM. Not addressed here.