agent-orchestrator/packages/web/server/__tests__
Gaurav Bhola 4684b75def feat(web): single-socket — multiplex terminals + sessions over one WebSocket
Replace three separate real-time channels (per-terminal WS, SSE, HTTP poll)
with a single persistent multiplexed WebSocket at /mux.

Architecture:
- Browser ↔ MuxProvider owns one WS connection per tab (/mux)
- Terminal I/O, resize, open/close all flow over mux channels
- Session status patches delivered via a shared SSE relay:
  mux server subscribes once to Next.js /api/events (SSE) and
  broadcasts to all connected browser clients — no per-client polling
- Manual WS upgrade routing fixes ws library limitation with multiple
  WebSocketServer instances on the same HTTP server

Remove:
- terminal-websocket.ts (legacy ttyd-based per-session server, port 14800)
- Per-terminal WebSocket connections from DirectTerminal
- Per-client 5 s HTTP polling for session patches

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-06 22:46:29 -07:00
..
direct-terminal-ws.integration.test.ts feat(web): single-socket — multiplex terminals + sessions over one WebSocket 2026-04-06 22:46:29 -07:00
server-compatibility.test.ts feat(web): single-socket — multiplex terminals + sessions over one WebSocket 2026-04-06 22:46:29 -07:00
tmux-utils.test.ts fix: terminal servers compatible with hash-based architecture (#87) 2026-02-18 03:28:55 +05:30