Open sourceAI engineering

Daniel (Agent Orchestrator)

A terminal orchestrator that fails over between Claude, Codex and Gemini so work continues when one runs out.

What it is

A single-file Python orchestrator that wraps the Claude, Codex and Gemini command-line tools with ordered role chains and automatic failover. Agents that hit limits are disabled with a cooldown and the next in the chain takes over. It can pull context from the knowledge base server before each answer.

What it does

  • Role chains: orchestrator, implementation, uidocs and review, each with a configurable agent order.
  • Auto-downtime detection for rate limits, quota exhaustion and auth failures, with cooldown timers.
  • Direct addressing (@claude, @codex, @gemini) and a smoke test across all enabled agents.
  • Searches the knowledge base server for task context before responding.

The problem

Each AI coding CLI hits usage limits and goes down. When one stops, work stops and context is lost. Daniel is a terminal orchestrator that wraps the Claude, Codex and Gemini CLIs and hands a message to the next agent in a chain when one fails.

Design decisions

  • Wrap the vendors' CLIs and use existing subscriptions, with an API mode available. This avoids per-token billing, but depends on CLI behaviour that can change.
  • Route by role chains (orchestrator, implementation, UI and docs, review), each with its own order. Everything is configurable, so the tradeoff is more setup choices.
  • Detect rate limits, quota and auth failures and put an agent on a timed or manual downtime. Failover is automatic for transient errors, and auth failures need a person.
  • Keep it as one Python file by design. It is easy to read and change, and harder to grow.

How it works

  1. REPL and commandsA terminal prompt takes messages, slash commands, role prefixes and direct @agent addressing.
  2. Role chainPicks the ordered list of agents to try for the message's role.
  3. ContextAdds the active task and results from a knowledge-base search before each response.
  4. Agent callsCalls the Claude, Codex or Gemini CLI or API in turn, until one succeeds.
  5. Auto-downtimeReads error patterns and disables an agent with a cooldown or manual recovery.

Security: enforced, simulated and known gaps

  • Enforced in code: a directory allow-list for agents, and a choice between two permission modes for Codex and Gemini.
  • Known gap: the default full-host-unattended mode lets Codex and Gemini act without approval prompts, so it assumes a trusted machine. The README tells users to pick sandboxed-auto to keep sandbox limits.

What broke and how it was fixed

What broke
Gemini calls hung when used non-interactively, because the Gemini CLI waited for a person to approve tool use.
How it was found
The commit message says the Gemini CLI waits for interactive tool approval when it is called non-interactively, for example from Daniel or with gemini -p.
The fix
The Gemini CLI call now passes the --yolo flag to auto-approve tools, and later commits made the permission mode configurable and closed stdin on subprocess calls.
What guards it now
The source records the fix and a smoke test command (/smoke) that tests every enabled agent. A dedicated regression test was not found in the repo.
Reference
8a14aec

Where it runs

A local command-line tool installed from GitHub with Python 3.10 or newer and at least one agent CLI. It is not hosted.

Who did what

The owner conceived the product, architecture, specs and acceptance tests and directed the work. Coding agents (Claude, Codex, Gemini) did much of the implementation and review. A commit note says Codex implemented, Claude verified and Gemini reviewed one change.

Limits and honest status

  • Single-file design by intent; README documents an extension path rather than a plugin system.
  • Codex and Gemini can run with full permissions unattended; README says to use this on trusted machines.
  • Last pushed 2026-04-03; the later swarm tooling is a separate project.

Connected to

Knowledge Base Server (Memstalker)Agent Swarm

Next: Agent Swarm — Keeps a team of coding agents working a task graph, with reviews and test gates between waves.