You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Same-id wake of a mounted terminal-view agent leaves the xterm frozen on the dead process #1281
cleanupSessionState deletes agentPtyAttachCounts[P] when the process exits, while the terminal-view pane stays mounted (AgentTerminalLeaf attaches once per sessionId). A same-id wake (deliverTextToSession, control/agents.ts, requestServerRestart) starts a new process whose bytes are buffered but never forwarded (count > 0 is false): the screen stays on the dead process while keystrokes reach the new one unseen, until a remount. Plain terminals do the same via terminalAttached. Severity P2.
Found by the Stage 3 C2 hunt; lines are origin/main 9c6e48f. Findings file: temp/quality-loop/hunt-c2.md.
PR #1311 fixes the agent half: the raw PTY attach count and restore size now survive process cleanup, and only the view's own detach releases them. Residual: plain terminals (terminalAttached) have no renderer detach call at all, so the same fix would leak one id per closed terminal. That half needs a detach first and stays open here.
Status after #1311 (merged via batch #1318, 2026-09-25).
Fixed (agent terminal view): PTY attach counts are owned by the renderer page and survive a same-id wake. A reload or crash releases a page's attaches, and each attach carries its page document, so a late detach from a dead page cannot take the live page's reference. The debug inline terminal releases only an attach main accepted. A mounted agent terminal keeps receiving the new process's output.
Still open: plain terminals have the same frozen-after-wake shape via terminalAttached.
Activity
Juliusolsson05 commentedon Sep 25, 2026
PR #1311 fixes the agent half: the raw PTY attach count and restore size now survive process cleanup, and only the view's own detach releases them. Residual: plain terminals (
terminalAttached) have no renderer detach call at all, so the same fix would leak one id per closed terminal. That half needs a detach first and stays open here.Juliusolsson05 commentedon Sep 25, 2026
Status after #1311 (merged via batch #1318, 2026-09-25).
Fixed (agent terminal view): PTY attach counts are owned by the renderer page and survive a same-id wake. A reload or crash releases a page's attaches, and each attach carries its page document, so a late detach from a dead page cannot take the live page's reference. The debug inline terminal releases only an attach main accepted. A mounted agent terminal keeps receiving the new process's output.
Still open: plain terminals have the same frozen-after-wake shape via
terminalAttached.