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

Orchestrator killed by tmux/host death has no path back to its own history — only recovery action is a cold, unlinked respawn

Open Hendrixx-RE opened this issue 3 months ago • 5 comments

Bug

When a project orchestrator's TUI runtime dies (host reboot, OS kill, tmux server loss), the only recovery actions reachable today discard its conversation history — even though that history is fully intact on disk (confirmed live: a 1.7MB Claude Code transcript survives untouched after the reboot) and the daemon already has a working resume mechanism (RestoreWithMode → GetRestoreCommand → RestoreIdentity) that's simply never invoked by the orchestrator-recovery flow. SpawnOrchestrator(clean=true) always spawns a brand-new session with no AgentSessionID carried forward from the retired one, and neither the topbar "Orchestrator" button nor RestoreUnavailableDialog ever attempt a real restore before discarding.

Basically when I swtiched to the terminal to talk to the orchastrator and restarted my pc,the tmux session is cleared and with that my chat was also gone,so I couldnt go back to the original orchastrator chat

Reproduction

  1. Run a project orchestrator (TUI, Claude Code) with real conversation history.
  2. Reboot the host without a graceful POST /shutdown (kills the tmux server backing the orchestrator's PTY).
  3. On next boot the orchestrator is still isTerminated: false but permanently unattachable.
  4. Kill / clean-respawn (POST /api/v1/orchestrators {"clean":true}) both 500 today — tracked in #4481/PR #4482.
  5. Even once that's fixed: the only recovery affordances (topbar "Orchestrator" button, RestoreUnavailableDialog's "create new orchestrator") call spawnOrchestrator(..., clean=true), which always creates a new session/conversation id — never attempts POST /sessions/{id}/restore against the just-retired orchestrator.

Acceptance Criteria

  • [ ] After a dead-runtime orchestrator is retired via clean respawn, AO attempts to resume its native conversation (the existing RestoreWithMode/GetRestoreCommand mechanism) before falling back to a fresh spawn.
  • [ ] If resume succeeds, the user lands back in the same conversation with full history intact.
  • [ ] If resume genuinely fails, the user is explicitly told the respawn started cold (extending the existing orchestratorRetireNotice mechanism) instead of silently swapping in a blank coordinator.
  • [ ] A "restore instead of replace" action is reachable from the actual orchestrator-recovery UI (topbar button / RestoreUnavailableDialog), not only from the Archived Sessions list.

Related

  • #4481 / PR #4482 — prerequisite mechanical fix (Kill/RetireForReplacement 500 on dead runtime).
  • #2501 — same underlying gap (orchestrator respawn with no linkage/notification), different trigger (probe race vs. host-level runtime death).

Hendrixx-RE avatar Aug 29 '26 12:08 Hendrixx-RE

Thanks for contributing to Agent Orchestrator.

This issue is being picked up by the current external contributor on-call pair:

  • @illegalcall
  • @somewherelostt

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 @illegalcall and @somewherelostt 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.

somewherelostt avatar Aug 29 '26 15:08 somewherelostt

Ill add this issue to the whole tmux overhaul on the linux version

Hendrixx-RE avatar Aug 30 '26 18:08 Hendrixx-RE

Turns out even after changing the terminal backend this issue persists for all provides who does not have a chat option so I made a pr which fixed a buggy loop which was blocking terminal restart and added a new session which calls chat history to get the conversation back @somewherelostt

Hendrixx-RE avatar Aug 31 '26 12:08 Hendrixx-RE

Assigned to @codebanditssss (Pls review the #4721)

Rishet11 avatar Sep 14 '26 22:09 Rishet11

the issue is valid but partly overlaps #4776: ao already has same-session restore support and promptless orchestrator relaunch coverage, but clean replacement and the recovery dialog still discard the old orchestrator by spawning a new id. the reboot path is also blocked when tmux reports an absent socket as an inconclusive probe, so reconciliation never reaches restore. the solution should classify that specific post-reboot socket absence as runtime unavailable, attempt native resume or same-session fresh relaunch first, and show an explicit cold-start notice only after resume fails. pr #4721 covers the missing recovery flow; pr #4859 covers the shared tmux probe gap.

codebanditssss avatar Sep 15 '26 15:09 codebanditssss