Daemon boot fails when an absent tmux socket is classified as infrastructure unavailable
Summary
AO Desktop would not start after the local tmux server had gone away. The daemon reached boot reconciliation, could not confirm cleanup for several terminated sessions, and exited with session: unsafe to serve.
This looks like a small follow-up to #3475 rather than the same bug returning. #3475 correctly made server-level tmux failures inconclusive so one outage could not archive every session. The case here is narrower: tmux 3.7b reports a genuinely missing socket as error connecting ... (No such file or directory), which is currently grouped with failures such as Permission denied.
Thanks for taking a look. I have included the environment, reproduction, and sanitized logs below; please let me know if another detail would help.
Environment
- Observed build: local integration commit
619bed7cb0118bd0f6c36adddb200dd44836a89f(ao versionreportsdev) - Compared with upstream
mainat3e2dbf424 - macOS arm64, zsh
- tmux 3.7b
- Go 1.26.5
The exact startup refusal was reproduced on the integration build, which already contains stricter fail-closed boot reconciliation. Upstream main shares the underlying tmux error classification but currently handles it more permissively, so it may not show the identical boot failure yet.
Steps to reproduce
-
Have one or more terminated sessions that still retain their tmux runtime handles for boot cleanup.
-
Stop the final tmux session so the tmux server socket no longer exists. A machine restart can produce the same state.
-
Start AO Desktop.
-
tmux returns exit 1 from
has-sessionwith:error connecting to <TMUX_SOCKET> (No such file or directory) -
Boot reconciliation treats the probe as inconclusive and refuses to serve because terminated runtime cleanup cannot be confirmed.
Expected behavior
AO should recognize that the old tmux server is absent, finish safe boot reconciliation, and restore any sessions that have restore markers.
Actual behavior
The daemon exits with code 1 and AO Desktop reports that the daemon failed to start.
Redacted logs
Usernames, home-directory paths, project/session names, timestamps, PIDs, and token-adjacent context have been replaced or omitted.
time=<TIMESTAMP> level=INFO msg="data-dir ownership acquired" lock=<AO_DATA_DIR>/daemon.lock pid=<DAEMON_PID>
time=<TIMESTAMP> level=ERROR msg="reconcile: live pass failed, skipping" sessionID=<ACTIVE_SESSION> error="reconcile <ACTIVE_SESSION>: probe: tmux runtime: probe session <ACTIVE_SESSION>: runtime: infrastructure unavailable: error connecting to <TMUX_SOCKET> (No such file or directory)"
time=<TIMESTAMP> level=ERROR msg="reconcile: reap pass left boot unsafe" sessionID=<TERMINATED_SESSION_1> error="session: unsafe to serve: terminated runtime reap unresolved: session <TERMINATED_SESSION_1> probe: tmux runtime: probe session <TERMINATED_SESSION_1>: runtime: infrastructure unavailable: error connecting to <TMUX_SOCKET> (No such file or directory)"
time=<TIMESTAMP> level=ERROR msg="reconcile: reap pass left boot unsafe" sessionID=<TERMINATED_SESSION_2> error="session: unsafe to serve: terminated runtime reap unresolved: session <TERMINATED_SESSION_2> probe: tmux runtime: probe session <TERMINATED_SESSION_2>: runtime: infrastructure unavailable: error connecting to <TMUX_SOCKET> (No such file or directory)"
reconcile sessions on boot: session: unsafe to serve: terminated runtime reap unresolved: session <TERMINATED_SESSION_1> probe: tmux runtime: probe session <TERMINATED_SESSION_1>: runtime: infrastructure unavailable: error connecting to <TMUX_SOCKET> (No such file or directory)
What I found
The tmux adapter currently treats every error connecting result as ErrRuntimeUnavailable. That is the right conservative answer for permission failures and unknown connection errors. For the specific ENOENT form, however, the old Unix socket—and therefore the old tmux server—is absent. A tmux pane cannot outlive that server process.
The distinction matters because steady-state board probes should remain conservative, while boot cleanup needs a safe way to recognize authoritative server absence.
Possible direction
One approach is a typed server-absence error beneath ErrRuntimeUnavailable:
- classify
no server running ...anderror connecting ... (No such file or directory)as authoritative server absence; - keep
Permission deniedand other connection failures inconclusive; - let boot recovery and cleanup explicitly consume the narrower subtype;
- keep steady-state observation fail-closed, preserving #3475's protection.
I opened #3801 with this approach, but I am happy to adjust the error boundary or test shape if maintainers prefer a different design.
Workaround used locally
Starting a temporary empty tmux session before relaunch allowed reconciliation to see the durable handles as missing. AO then started and restored the active session, after which the temporary tmux session was removed. No database rows or worktrees were edited.
Related
- #3475 — protects the board from treating a server-level outage as many independent session deaths.
- #3801 — proposed narrow distinction for authoritative socket absence.
One clarification after comparing this with upstream main: I reproduced the exact startup refusal on integration commit 619bed7cb, which already has stricter fail-closed boot reconciliation. Upstream shares the underlying tmux classification but currently handles ErrRuntimeUnavailable more permissively, so it may not show the identical startup failure yet.
PR #3801 focuses on the shared distinction between a genuinely absent socket and an ambiguous connection failure. Sorry that this scope was not clear in the first version of the report; I have updated the issue body as well.
I was not able to apply labels with my current repository permissions. My suggestion would be bug, P2, and comp/daemon, but please adjust those as you see fit. Thank you.
I'd like to work on this. I opened #3801 before waiting for assignment, which did not follow CONTRIBUTING.md's expected order. I have converted it to draft and will not request review or continue upstream implementation unless maintainers assign this issue and confirm the scope. If you prefer, I will close the draft.
Thanks for contributing to Agent Orchestrator.
This issue is being picked up by the current external contributor on-call pair:
- @neversettle17-101
- @illegalcall
If someone is already working on this, please continue as usual. The on-call pair is added for visibility, tracking, and support, not to take over the work. If you need help with review, direction, reproduction, or next steps, please tag @neversettle17-101 and @illegalcall here.
For faster context or live questions, you can also join the AO Discord.
Join the session here: https://discord.gg/H6ZDcUXmq
Come by if you want to see what is being built, ask questions, or just hang around with the community.
Hi @somewherelostt
PR for the issue: https://github.com/Untrivial-ai/agent-orchestrator/pull/3801
Closing as fixed by #4859. The merged change classifies a missing tmux socket as a conclusive absent server on current main, so daemon startup no longer treats this clean-boot state as an infrastructure failure.