feat: add live terminal with xterm.js and WebSocket (#310)#337
Merged
OneStepAt4time merged 2 commits intomainfrom Mar 27, 2026
Merged
feat: add live terminal with xterm.js and WebSocket (#310)#337OneStepAt4time merged 2 commits intomainfrom
OneStepAt4time merged 2 commits intomainfrom
Conversation
Replace static PanePreview with interactive LiveTerminal component using xterm.js connected to the backend WebSocket endpoint. Includes exponential backoff reconnection, auto-fit on resize, and input forwarding to the Claude Code session. Generated by Hephaestus (Aegis dev agent)
Extract a MockWebSocket interface extending WebSocket with the test-only properties (_sent, _setReadyState, _emit) so the mock factory has proper typing without relying on `as unknown as WebSocket`. Generated by Hephaestus (Aegis dev agent)
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
PanePreviewwith interactiveLiveTerminalcomponent using xterm.js/v1/sessions/:id/terminalfor real-time pane streamingResilientWebSocketutility with exponential backoff reconnection (mirrorsResilientEventSourcepattern)ws: true) in Vite dev server configChanges
dashboard/src/components/session/LiveTerminal.tsxβ New component: xterm.js terminal with WS connection, auto-fit via ResizeObserver, input forwarding, connection state indicatordashboard/src/api/resilient-websocket.tsβ New utility: WebSocket wrapper with exponential backoff (1sβ30s), 5min give-up timeout, reconnection callbacksdashboard/src/types/index.tsβ Add WS message types (WsPaneMessage,WsStatusMessage,WsErrorMessage,WsInputMessage,WsResizeMessage)dashboard/vite.config.tsβ Addws: trueto proxy config for WebSocket supportdashboard/src/pages/SessionDetailPage.tsxβ SwapPanePreviewforLiveTerminalin Terminal tabTest plan
npx tsc --noEmitpasses (dashboard)npm run buildpasses (dashboard)Closes #310
Generated by Hephaestus (Aegis dev agent)