agent-orchestrator icon indicating copy to clipboard operation
agent-orchestrator copied to clipboard

`ao start` fails when stale orchestrator session exists

Open prod-blip opened this issue 7 months ago • 2 comments

Problem

When running ao start, if a previous orchestrator session exists (e.g., from a crashed or improperly terminated run), the command fails with:

Error: Failed to setup orchestrator: Session ao-orchestrator already exists but is not in a reusable state

The user must manually run tmux kill-session -t {hash}-ao-orchestrator before ao start works again.

Screenshot

Image

Expected Behavior

ao start should handle stale orchestrator sessions gracefully:

  • Auto-detect if the existing orchestrator is actually running and healthy
  • If stale/dead, automatically clean it up and proceed
  • Or provide a clear --force flag to override

Steps to Reproduce

  1. Run ao start
  2. Kill the process (Ctrl+C or terminal crash)
  3. Run ao start again
  4. Error occurs

Environment

  • OS: macOS
  • tmux sessions persist after AO exit

Suggested Fix

Either:

  1. Default orchestratorSessionStrategy to kill-previous
  2. Detect stale sessions (tmux exists but process unhealthy) and auto-cleanup
  3. Add ao start --force to bypass the check

prod-blip avatar Apr 07 '26 19:04 prod-blip

Even after deleting the tmux sessions, the ao start was throwing error.

Error

Session ao-orchestrator already exists but is not in a reusable state
apple@apples-MacBook-Pro agent-orchestrator % tmux list-sessions
no server running on /private/tmp/tmux-501/default

Observation

The tmux session is gone, but the metadata file still exists. AO checks metadata files, not just tmux.

prod-blip avatar Apr 07 '26 19:04 prod-blip

I tried reproducing the same error on my machine. But it works completely fine on my machine.

Image

i will request you checking it again and confirm the results. If it works fine , please close the issue.

whoisasx avatar Apr 11 '26 15:04 whoisasx