GenServer-Supervised Coding Agents with Per-Issue Isolated Workspaces

repoelixirotpagent-loopsmulti-agentorchestrationkokogitphoenixliveview

Direct reference implementation for Koko's OTP orchestration model — GenServer dispatch loop, pluggable agent adapters, and per-issue isolated workspace clones map cleanly to joelclaw's agent-loop infrastructure

Jido Symphony is a multi-agent coding orchestrator built in Elixir/Phoenix. A GenServer polls an issue tracker, dispatches up to N coding agents in parallel into isolated git workspace clones, and merges their feature branches back to trunk automatically. It’s built on top of OpenAI’s Symphony reference implementation and extends it with multi-agent support, automatic merge with LLM conflict resolution, and a project bootstrapping flow.

The core loop is clean: poll the tracker, pick an open issue, spawn an agent in an isolated workspace clone, let it work, commit to a feature branch, merge (with LLM conflict resolution if needed), close the issue, repeat. The orchestrator is a plain GenServer polling every 5 seconds. Each agent runs in a supervised process with its own workspace directory — OTP crash isolation is built-in, not bolted on. If an agent blows up mid-issue, the supervisor restarts it without touching the other agents running in parallel.

The agent adapters are pluggable: GitHub Copilot CLI (JSON-RPC over stdio), Codex, or echo for testing. All three implement the same interface. Configuration lives in a WORKFLOW.md file that travels with the target project — YAML frontmatter for runtime config (tracker kind, workspace root, agent adapter, concurrency limit, polling interval) plus a Markdown/Liquid body as the per-issue prompt template. The bootstrapper asks the LLM to decompose a project description into 10-15 focused issues, then immediately starts dispatching agents against them.

LiveView drives the monitoring dashboard — real-time agent status, token usage, retry queue — over PubSub without any client-side JS framework. Issue trackers supported include Beads (a local Kanban CLI), Linear, GitHub Issues, and an in-memory adapter for testing. For Koko work specifically, this is a direct reference implementation of the OTP orchestration model joelclaw is building toward.

Key Ideas

  • GenServer as orchestrator — polls issue tracker on interval, manages up to N parallel agents, handles retry backoff and triggers the merge pipeline after each agent run
  • Per-issue isolated workspace clones — each agent gets its own full git checkout, preventing state collision between parallel agents working the same repo
  • Feature branch + LLM conflict resolution — pull trunk into branch, resolve conflicts with the LLM if needed, fast-forward merge to trunk, push; the whole merge pipeline is automated
  • Pluggable agent adaptersghcopilot, codex, echo all implement the same interface; swap the backend without changing orchestration logic
  • WORKFLOW.md as declarative project config — lives in the target repo, not in Symphony; YAML frontmatter for runtime config, Liquid template for the per-issue agent prompt
  • Project bootstrapping via LLM decomposition — describe the app, specify tech stack and concurrency, LLM generates 10–15 focused issues and commits them to the tracker before any agents start
  • LiveView dashboard — real-time monitoring of running agents, token usage, retry queue, and individual agent tool call traces; no JavaScript framework
  • Hooks systemafter_create, before_run, after_run shell scripts per workspace; receives SYMPHONY_ISSUE_ID and SYMPHONY_ISSUE_TITLE as env vars, making git workflow fully configurable