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

Existing orchestrator sessions do not pick up agent changes from agent-orchestrator.yaml

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

Summary

If the configured agent is changed in agent-orchestrator.yaml, existing orchestrator sessions continue running with the old agent instead of picking up the new configuration.

This makes the config change appear ineffective until the old orchestrator session is manually killed and a new one is started.

Repro

  1. Start AO with a project configured to use one agent, for example:
    • defaults.agent: claude-code
  2. Let AO create an orchestrator session.
  3. Change the config to use a different agent, for example:
    • defaults.agent: codex or
    • projects..orchestrator.agent: codex
  4. Restart with ao start.
  5. Observe that the existing orchestrator session is reused and still runs with the old agent.

Actual behavior

  • Existing orchestrator sessions keep the agent they were originally created with.
  • Config changes to orchestrator agent selection are not applied to already-running orchestrators.
  • From the user perspective, changing YAML does not seem to work.

Expected behavior

One of the following should happen clearly and consistently:

  1. AO should recreate the orchestrator when the configured orchestrator agent changes.
  2. Or AO should warn clearly that an existing orchestrator is pinned to the old agent.
  3. Or AO should expose a first-class command/flow to refresh the orchestrator from current config.

Why this matters

Users expect agent-orchestrator.yaml to be the source of truth for orchestrator behavior.

Right now:

  • the persisted old orchestrator session effectively overrides the new config
  • the system feels inconsistent
  • debugging is confusing, especially when switching between Claude and Codex due to limits or testing

Suspected cause

ao start prefers reusing an existing non-terminal orchestrator session for the project, and that session already has persisted metadata including the agent it was launched with.

As a result, the new YAML config is not applied to that existing orchestrator instance.

Suggested fixes

  • Detect orchestrator agent config drift and recreate the orchestrator automatically.
  • Or print a clear message like:
    • “Existing orchestrator is using claude-code; config now requests codex. Kill/recreate to apply changes.”
  • Or add a --refresh-orchestrator / --recreate-orchestrator option to ao start.
  • Consider making orchestrator reuse conditional on config compatibility, not just session existence.

prod-blip avatar Apr 08 '26 15:04 prod-blip

I’d like to take this issue.

Proposed approach

  • Trace ao start orchestrator reuse path in packages/cli/src/commands/start.ts.
  • Add a compatibility check so existing non-terminal orchestrators are reused only when their persisted agent matches current configured orchestrator agent.
  • If existing orchestrators are incompatible, create a new orchestrator instead of reusing stale one.
  • Add focused tests in packages/cli/__tests__/commands/start.test.ts for:
    • all existing orchestrators incompatible -> spawn new
    • mixed existing orchestrators -> reuse compatible one only

Validation plan

  • pnpm --filter @aoagents/ao-cli typecheck
  • pnpm --filter @aoagents/ao-cli test -- start

If this approach looks good, please assign me and I’ll open the PR.

sparshb4tra avatar Apr 14 '26 15:04 sparshb4tra

Closing this as part of the migration cleanup for the ground-up rewrite of Agent Orchestrator.

This item was opened more than a month before the migration batch and the codebase has been replaced, so this thread no longer maps cleanly onto the current source tree.

If something here still needs tracking, please reopen this item or open a fresh one against the new tree. Thank you for contributing.

harshitsinghbhandari avatar Jun 24 '26 14:06 harshitsinghbhandari