agent-orchestrator/backend
Pritom14 67f42150b4 fix(terminal): make creackPTY.Close idempotent to avoid shutdown deadlock
The session run loop closes the PTY after copyOut returns, and session.close
(via Manager.Close) closes the same PTY again. creackPTY.Close called cmd.Wait
each time, and a second concurrent Wait on the same process blocks forever, so
daemon shutdown deadlocked whenever a terminal was still attached. fakePTY is
idempotent via sync.Once, so the unit suite never exercised this; a real tmux
attach surfaced it.

Guard close+kill+wait with a sync.Once so Wait runs exactly once. Add a
regression test that double-closes a real PTY under a watchdog.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-31 20:46:12 +05:30
..
internal fix(terminal): make creackPTY.Close idempotent to avoid shutdown deadlock 2026-05-31 20:46:12 +05:30
cdc_wiring.go feat(backend): port lifecycle lane onto the new storage+CDC model 2026-05-31 07:16:06 +05:30
go.mod feat(httpd): mount terminal-streaming WebSocket at /mux 2026-05-31 19:23:35 +05:30
go.sum feat(terminal): PTY-attach terminal streaming feature package 2026-05-31 19:23:35 +05:30
lifecycle_wiring.go feat(backend): atomic PR-observation write + CDC on check status updates 2026-05-31 17:02:47 +05:30
main.go feat(backend): wire terminal manager into the daemon at /mux 2026-05-31 19:23:35 +05:30
sqlc.yaml feat(backend): SQLite storage layer + CDC pipeline, LCM/reaper wiring 2026-05-30 16:02:07 +05:30
wiring_test.go feat(backend): port lifecycle lane onto the new storage+CDC model 2026-05-31 07:16:06 +05:30