feat: server-first terminal creation, broadcast-only WS clients
- Add POST /create-terminal endpoint with MAX_TERMINALS=5 limit - Server creates PTY, runs command, registers and broadcasts atomically - Frontend startTerminal() calls server first, connects in reconnect mode - Remove registerTerminalOnServer() — server handles registration - Separate broadcast-only WS clients from PTY clients (no phantom "main" PTY) - All broadcast functions use broadcastToAll() helper - Fix resume existing flow to create terminal with --resume flag
This commit is contained in:
@@ -40,6 +40,9 @@ const {
|
||||
switchAgent,
|
||||
selectSession,
|
||||
createNewSession,
|
||||
startTerminal,
|
||||
parkCurrentTerminal,
|
||||
fetchSessionContent,
|
||||
switchToTerminal,
|
||||
closeTerminal,
|
||||
disconnectRealtime,
|
||||
@@ -468,7 +471,11 @@ async function handleModalResume(sessionId: string, agent: AgentName) {
|
||||
if (agent !== selectedAgent.value) {
|
||||
await switchAgent(agent)
|
||||
}
|
||||
selectSession(sessionId)
|
||||
// Load transcript + create terminal with --resume
|
||||
parkCurrentTerminal()
|
||||
selectedSessionId.value = sessionId
|
||||
await fetchSessionContent(sessionId)
|
||||
await startTerminal(sessionId)
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
|
||||
Reference in New Issue
Block a user