Skip to content

Couple workers to orchestrator runtime#97

Merged
frantic-openai merged 1 commit into
mainfrom
codex/fix-orchestrator-worker-restart
Jul 17, 2026
Merged

Couple workers to orchestrator runtime#97
frantic-openai merged 1 commit into
mainfrom
codex/fix-orchestrator-worker-restart

Conversation

@frantic-openai

@frantic-openai frantic-openai commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

Context

Orchestrator restarts reset in-memory claims, but sibling TaskSupervisor workers could survive and be redispatched concurrently.

TL;DR

Supervise agent workers and the orchestrator as one restart unit.

Summary

  • Add an AgentRuntimeSupervisor with TaskSupervisor and Orchestrator under :one_for_all.
  • Route agent task starts and stops through the runtime-owned task supervisor.
  • Make public and test restart paths operate on the runtime subtree as a unit.
  • Add a real memory-tracker dispatch regression for hard-kill restart recovery.

Alternatives

  • Startup cleanup fixed the narrow case but encoded ownership in callbacks instead of supervision.
  • Durable leases are broader than Symphony's in-memory restart contract.

Test Plan

  • make -C elixir all
  • mise exec -- mix test --repeat-until-failure 10 test/symphony_elixir/core_test.exs:228
  • mise exec -- mix test --cover --seed 155984 --max-cases 8
  • mise exec -- mix test test/symphony_elixir/core_test.exs test/symphony_elixir/orchestrator_status_test.exs

@frantic-openai
frantic-openai force-pushed the codex/fix-orchestrator-worker-restart branch from 2acb1ed to b4f5f49 Compare July 17, 2026 20:58
@frantic-openai frantic-openai changed the title Stop workers across orchestrator restarts Couple workers to orchestrator runtime Jul 17, 2026
Summary:
- Supervise TaskSupervisor and Orchestrator as a one-for-all runtime.
- Route agent task starts and stops through the owned supervisor.
- Add a real dispatch regression for restart redispatch overlap.

Rationale:
- A sibling task supervisor let workers outlive the scheduler state that
  claimed them after an orchestrator restart.
- Encoding lifecycle ownership in supervision avoids duplicate work without
  adding cleanup sweeps or durable leases.

Tests:
- mise exec -- mix test --repeat-until-failure 10
  test/symphony_elixir/core_test.exs:228
- mise exec -- mix test test/symphony_elixir/core_test.exs
  test/symphony_elixir/orchestrator_status_test.exs
- mise exec -- make all

Co-authored-by: Codex <codex@openai.com>
@frantic-openai
frantic-openai force-pushed the codex/fix-orchestrator-worker-restart branch from b4f5f49 to 22d21a5 Compare July 17, 2026 21:27
@frantic-openai
frantic-openai merged commit 476b2b0 into main Jul 17, 2026
3 checks passed
@frantic-openai
frantic-openai deleted the codex/fix-orchestrator-worker-restart branch July 17, 2026 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant