agent-orchestrator/packages/plugins
Harshit Singh Bhandari 845fffdfd9
fix(runtime-tmux,web): keep tmux session alive after agent exit (#1758)
* fix: keep tmux session alive after agent exit (closes #1756)

Two related fixes:

1. runtime-tmux: append `exec "${SHELL:-/bin/bash}" -i` to the launch
   command so the pane drops to an interactive shell when the agent
   exits, instead of letting the empty pane take down the whole tmux
   session. The lifecycle still detects agent termination via
   `agent.isProcessRunning` and transitions the session to
   `agent_process_exited` — the runtime just stays usable so the user
   can run shell commands or manually re-launch the agent.

2. mux-websocket: add a `tmux has-session` guard at the top of
   `pty.onExit`. When the tmux session is genuinely gone (e.g. `ao
   stop` killed it out from under a still-subscribed dashboard), skip
   the three doomed `attach-session` spawns introduced by the
   MAX_REATTACH_ATTEMPTS bound in #1640 and notify subscribers
   immediately. The bound from #1640 still covers transient
   tmux-server hiccups where the session does still exist.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(mux): make tmuxHasSession async to avoid blocking the event loop

The has-session probe added in #1756 ran via execFileSync inside
node-pty's onExit callback, freezing every WebSocket connection,
HTTP request, and in-flight terminal for up to the 5 s subprocess
timeout whenever an agent exited and tmux was slow to respond.

Switch tmuxHasSession to promisified execFile and await it from the
onExit handler, mirroring the execFileAsync pattern in runtime-tmux.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-10 19:41:03 +05:30
..
agent-aider feat(windows): complete Windows support (#1025) 2026-05-09 00:10:53 +05:30
agent-claude-code feat(windows): complete Windows support (#1025) 2026-05-09 00:10:53 +05:30
agent-codex feat(windows): complete Windows support (#1025) 2026-05-09 00:10:53 +05:30
agent-cursor feat(windows): complete Windows support (#1025) 2026-05-09 00:10:53 +05:30
agent-kimicode feat(windows): complete Windows support (#1025) 2026-05-09 00:10:53 +05:30
agent-opencode feat(windows): complete Windows support (#1025) 2026-05-09 00:10:53 +05:30
notifier-composio chore: release 0.6.0 (#1723) 2026-05-08 02:37:44 +05:30
notifier-desktop feat(windows): complete Windows support (#1025) 2026-05-09 00:10:53 +05:30
notifier-discord chore: release 0.6.0 (#1723) 2026-05-08 02:37:44 +05:30
notifier-openclaw chore: release 0.6.0 (#1723) 2026-05-08 02:37:44 +05:30
notifier-slack chore: release 0.6.0 (#1723) 2026-05-08 02:37:44 +05:30
notifier-webhook chore: release 0.6.0 (#1723) 2026-05-08 02:37:44 +05:30
runtime-process feat(windows): complete Windows support (#1025) 2026-05-09 00:10:53 +05:30
runtime-tmux fix(runtime-tmux,web): keep tmux session alive after agent exit (#1758) 2026-05-10 19:41:03 +05:30
scm-github feat(windows): complete Windows support (#1025) 2026-05-09 00:10:53 +05:30
scm-gitlab chore: release 0.6.0 (#1723) 2026-05-08 02:37:44 +05:30
terminal-iterm2 chore: release 0.6.0 (#1723) 2026-05-08 02:37:44 +05:30
terminal-web chore: release 0.6.0 (#1723) 2026-05-08 02:37:44 +05:30
tracker-github feat(windows): complete Windows support (#1025) 2026-05-09 00:10:53 +05:30
tracker-gitlab chore: release 0.6.0 (#1723) 2026-05-08 02:37:44 +05:30
tracker-linear chore: release 0.6.0 (#1723) 2026-05-08 02:37:44 +05:30
workspace-clone feat(windows): complete Windows support (#1025) 2026-05-09 00:10:53 +05:30
workspace-worktree fix(workspace-worktree): restore re-attaches existing branch instead of recreating with -b (#1742) 2026-05-09 22:07:32 +05:30