In-browser terminal attached to worker tmux session #7
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lz/agent-nexus#7
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Add a Terminal button to each session card that opens a browser-based terminal attached to the worker container's
claudetmux session — without requiring the user to leave the UI or rundocker execmanually.Motivation
Each
nexus-workercontainer runs tmux as PID 1 with a session namedclaude. Currently the only way to inspect live agent output, send input, or interrupt a stuck run is todocker exec -it <container> tmux attachfrom the host. This is fine for power users but breaks the self-contained UX that agent-nexus otherwise provides, and it's completely unavailable to anyone accessing the UI remotely (e.g. from the Claude mobile app flow).Since agent-nexus already has:
execon the allowlistnexus-managed=true)...the infrastructure to build this is essentially already in place.
Proposed implementation
Backend (
nexus/):GET /api/sessions/:id/terminaldocker execagainst the worker container via the socket proxy, passing-itto allocate a PTY, with the commandtmux attach -t claudeSIGWINCHvia the Docker exec resize API (POST /exec/:id/resize?h=&w=)tmux detach-clientor close the exec stream)Frontend (
nexus/web/):onData→ WebSocket send, and WebSocketonmessage→xterm.write()FitAddonto track terminal dimensions and send resize events to the backendRelevant constraints
execendpoints (EXEC_CREATE,EXEC_START,EXEC_INSPECTin the Tecnativa proxy config) — no proxy config change should be needed, but worth verifyingEXEC_RESIZEis also allowedtmux attachwill fail with a socket permission errorclaude(per the worker entrypoint) — the backend can rely on thisexitorkill-sessionaccidentally on WebSocket disconnect; preferdetach-client -s claudebefore closing the exec streamOut of scope for this issue