Problem
startTtyd() in src/adapters/tmux-adapter.ts spawns ttyd via Bun.spawn() with .unref(), but no setsid. The ttyd processes remain children of the orchestration runner. When the runner exits or is killed, all ttyd processes for that slot die too, causing "refused to connect" in the dashboard terminals tab.
This is the same class of issue fixed for the runner itself (setsid wrap in slot start). The fix should apply the same setsid pattern to ttyd spawning.
Evidence
After migrating federation controller to mac-studio, all per-slot ttyd processes (ports 7681-7692) died while runners stayed alive. Only the Mag ttyd (port 7679) survived. slot resume re-creates them but they die again on next runner restart.
Fix
Wrap ttyd spawn with setsid in startTtyd() (~line 237):
const proc = Bun.spawn(
["setsid", "ttyd", "--writable", "--port", String(port), "tmux", "attach", "-t", target],
{ stdin: "ignore", stdout: "ignore", stderr: "ignore" },
);
Related
startTtyd() in src/adapters/tmux-adapter.ts:228-243
- Slot resume re-creation in
src/slots/index.ts:894-906 (same pattern, also needs setsid)
Problem
startTtyd()insrc/adapters/tmux-adapter.tsspawns ttyd viaBun.spawn()with.unref(), but nosetsid. The ttyd processes remain children of the orchestration runner. When the runner exits or is killed, all ttyd processes for that slot die too, causing "refused to connect" in the dashboard terminals tab.This is the same class of issue fixed for the runner itself (setsid wrap in slot start). The fix should apply the same
setsidpattern to ttyd spawning.Evidence
After migrating federation controller to mac-studio, all per-slot ttyd processes (ports 7681-7692) died while runners stayed alive. Only the Mag ttyd (port 7679) survived.
slot resumere-creates them but they die again on next runner restart.Fix
Wrap ttyd spawn with
setsidinstartTtyd()(~line 237):Related
startTtyd()insrc/adapters/tmux-adapter.ts:228-243src/slots/index.ts:894-906(same pattern, also needs setsid)