agent-orchestrator/backend/internal/terminal
Pritom14 eda39a156a fix(terminal): guard subscribe-to-assign window in openTerminal
A session can exit and run onExit (which deletes c.terms[id]) in the gap
between subscribe returning exited=false and openTerminal assigning
c.terms[id]. The delete is a no-op there since the key isn't set yet, so
the later assign resurrects a stale entry for a dead pane, trapping every
future open for that id on the connection. Re-apply the delete after the
assign when onExit fired in the window, tracked by a c.mu-guarded flag.

Add a stress regression test that races the exit against the assign.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-31 23:42:59 +05:30
..
doc.go feat(terminal): PTY-attach terminal streaming feature package 2026-05-31 19:23:35 +05:30
fakes_test.go feat(terminal): PTY-attach terminal streaming feature package 2026-05-31 19:23:35 +05:30
manager.go fix(terminal): guard subscribe-to-assign window in openTerminal 2026-05-31 23:42:59 +05:30
manager_test.go fix(terminal): guard subscribe-to-assign window in openTerminal 2026-05-31 23:42:59 +05:30
protocol.go feat(backend): wire terminal manager into the daemon at /mux 2026-05-31 19:23:35 +05:30
protocol_test.go feat(backend): wire terminal manager into the daemon at /mux 2026-05-31 19:23:35 +05:30
pty_unix.go fix(terminal): make creackPTY.Close idempotent to avoid shutdown deadlock 2026-05-31 20:46:12 +05:30
pty_unix_test.go fix(terminal): make creackPTY.Close idempotent to avoid shutdown deadlock 2026-05-31 20:46:12 +05:30
pty_windows.go feat(terminal): PTY-attach terminal streaming feature package 2026-05-31 19:23:35 +05:30
ring.go feat(terminal): PTY-attach terminal streaming feature package 2026-05-31 19:23:35 +05:30
ring_test.go feat(terminal): PTY-attach terminal streaming feature package 2026-05-31 19:23:35 +05:30
session.go fix(terminal): keep open re-servable after a pane exits 2026-05-31 23:04:15 +05:30
session_integration_test.go feat(terminal): PTY-attach terminal streaming feature package 2026-05-31 19:23:35 +05:30
session_test.go feat(terminal): PTY-attach terminal streaming feature package 2026-05-31 19:23:35 +05:30