From 7830fb8d8d5a913f7ad7460cba5a12daec96535e Mon Sep 17 00:00:00 2001 From: jester Date: Sun, 18 Jan 2026 22:48:19 +0000 Subject: [PATCH] Append Jan 14-18 2026 session - Agent PTY Console Breakthrough, interactive bidirectional console complete --- SESSION_LOG.md | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/SESSION_LOG.md b/SESSION_LOG.md index 173f810..d07b608 100644 --- a/SESSION_LOG.md +++ b/SESSION_LOG.md @@ -202,3 +202,42 @@ separation between **host health**, **agent availability**, and **service runtim ### Next Focus - Console (read-only output first) + +--- + +## 2026-01-14 → 2026-01-18 — Agent PTY Console Breakthrough + +### Objective +Replace log-only console streaming with a **true interactive PTY-backed console** +supporting: +- Dev server shell access +- Game server (Minecraft) live console +- Full duplex WebSocket I/O +- Session persistence across reconnects + +### What Changed +- Agent console migrated from log tailing → **PTY-backed processes** +- PTY ownership moved to agent (not frontend, not Proxmox) +- WebSocket implementation replaced with `gorilla/websocket` +- Enforced **single writer per WS connection** +- Introduced **console session manager** keyed by `{vmid, container_type}` +- Sessions survive WS disconnects (dev servers only, TTL = 60s) +- PTY not killed on client close +- Added keepalive frames (5s) to prevent browser timeouts +- Added detailed WS + PTY logging for attach, read, write, close + +### Architecture Summary +- Dev containers attach to `/bin/bash` (fallback `/bin/sh`) +- Game containers attach to Minecraft server PTY +- WS input → PTY stdin +- PTY stdout → WS broadcast +- One PTY reader loop per session +- Multiple WS connections can attach/detach safely + +### Final Status +✅ Interactive console confirmed working +✅ Commands execute correctly +✅ Output streamed live +✅ Reconnect behavior stable + +This closes the original "console v2" milestone.