caadd59441
Move the following audited-and-implemented changes into openspec/changes/archive/2026-06-12-completed-changes-archive/: - backend-frontend-refactoring - config-profile-git-mounts - config-profile-includes-ui - config-profile-multi-repo-mounts - container-monitoring-notifications - git-mount-url-validation - home-path-expansion - mobile-terminal-ux - mount-specificity-ordering - notification-center - persistent-terminal-sessions - session-list-overhaul - ssh-key-mounting - terminal-fullscreen-unified-header - tool-session-progress-and-updates Also regenerated .pi-map*.md files for openspec/changes so the remaining active changes (multi-session-terminal-ux, reorganize-long-files, working-copies, workspace-first-ui) reflect the new layout.
1.7 KiB
1.7 KiB
Why
Currently, each WebSocket connection to a terminal spawns a new docker exec process. When the user disconnects (e.g., closes the browser tab, navigates away, or loses network), their shell session is killed and all state is lost. This is frustrating for users who expect their terminal session to persist like a traditional SSH session. We need persistent terminal sessions that survive reconnections.
What Changes
- Backend: Refactor
TerminalManagerto track sessions byinstance_idinstead of generating a new session per WebSocket connection - Backend: Support reattaching to an existing
docker execprocess when a WebSocket reconnects - Backend: Add session reset functionality (kill existing shell and start fresh)
- Backend: Add idle timeout-based cleanup for abandoned sessions
- Frontend: Add "Reset Terminal" button in the UI
- Frontend: Handle reconnection gracefully with buffer replay of recent output
Capabilities
New Capabilities
persistent-terminal: Terminal sessions persist across WebSocket reconnections, maintaining shell state and history
Modified Capabilities
terminal-session-management: Existing terminal session creation and lifecycle behavior changes to support reconnection instead of always creating new sessions
Impact
apps/api/src/services/terminal_manager.py: Major refactoring to support instance-keyed sessionsapps/api/src/services/terminal_session.py: Support multiple/detached WebSocket connectionsapps/api/src/api/terminal.py: Attach to existing session logicapps/web/src/components/terminal.tsxor related: Add reset button, handle reconnectionapps/web/src/hooks/use-terminal.tsor related: Buffer replay on reconnect