How an AI Agent Orchestrator Self‑Built 40K Lines of TypeScript in 8 Days

In eight days the author used a recursively evolving AI agent orchestrator to generate 40,000 lines of TypeScript, 17 plugins, and 3,288 tests, demonstrating parallel task decomposition, self‑healing CI, and a fully pluggable architecture that automates code review and deployment.

DeepNoMind
DeepNoMind
DeepNoMind
How an AI Agent Orchestrator Self‑Built 40K Lines of TypeScript in 8 Days

Motivation and Early Bottleneck

The author started with a backlog of tasks but quickly became the bottleneck, spending most of the time reviewing CI results, reading pull‑request comments, and copying error messages back into agent dialogs. Human attention limited scalability.

Initial Automation with Bash Scripts

To relieve the bottleneck, the author wrote ~2,500 lines of Bash that managed tmux sessions, git worktree switches, and tag navigation. Each agent ran in its own session, and the orchestrator could jump to a PR’s tab with a single command.

Recursive Evolution of the Orchestrator

After the Bash layer, the agents themselves built the first version (V1) of the orchestrator, which then managed a second‑generation set of agents (V2). From that point V2 continuously self‑improved.

Results

The system produced 40,000 lines of TypeScript , 17 plugins , and 3,288 test cases in eight days, most of which were written by the agents. Every commit is tagged with the AI model that generated it, making the human‑vs‑agent contribution transparent.

Core Logic of the Orchestrator

The orchestrator is itself an AI agent, not a dashboard or cron job. It reads the codebase, understands requirements, decomposes features into parallel tasks, assigns them to coding agents, and monitors progress. When CI fails, the failure is injected into the relevant agent session, which reads the logs and fixes the issue. Review comments are routed to the appropriate agent with full context, eliminating the need for a human “middle‑man”.

Self‑Healing CI

CI failures trigger the ci_failed reaction, which spawns an agent with the prompt “CI failed on this PR. Read the logs and fix the problem.” Similarly, review comments trigger a changes_requested reaction. Successful approvals send a Slack notification. This workflow resolved 41 CI failures across nine branches, achieving an overall CI success rate of 84.6% .

Full Automation of Code Review

Agent creates a PR and pushes code.

Cursor Bugbot automatically adds inline comments.

Agent reads the comments, fixes the code, and pushes again.

Bugbot re‑reviews the updated PR.

During this cycle the system generated 700 automated review comments , fixing about 68% of the reported issues.

Plugin‑Based Architecture

The orchestrator offers eight replaceable plugin slots, allowing any component—tracker, runtime, agent implementation, notification channel—to be swapped. It works with Claude Code, Aider, GitHub, Linear, tmux, Docker, etc.

Session Lifecycle

Tracker : pulls an issue from GitHub or Linear.

Workspace : creates an isolated worktree or clone.

Runtime : starts a tmux session or process.

Agent : a coding model (e.g., Claude Code, Aider) works autonomously.

Terminal : user can observe the live terminal via iTerm2 or the web UI.

SCM : creates PRs enriched with context.

Reactions : automatically restarts agents on CI failure or review feedback.

Notifier : pings the human only when a decision is required.

Activity Detection

Agents emit structured JSONL event files (e.g., from Claude Code). The orchestrator parses these files directly to determine whether an agent is generating tokens, waiting on a tool, idle, or finished, avoiding reliance on self‑reports.

Web Dashboard

Built with Next.js 15 and Server‑Sent Events, the dashboard provides attention zones, a live terminal (xterm.js), session details, and automatic discovery of ao.config.yaml. It shows real‑time status without polling.

Self‑Improving AI Loop

Each agent session logs signals such as which prompts produced clean PRs, which caused CI failures, and which led to merge conflicts. The orchestrator’s ao‑52 subsystem records these metrics, reviews them, and adjusts future task allocations, creating a closed feedback loop: agents build features → orchestrator observes outcomes → orchestrator updates policies → agents become more effective.

Future Directions

Remote conversational interfaces (Telegram, Slack) for status checks and approvals.

Improved feedback handling to correct agents before they waste time.

Automatic upgrades of agents or the orchestrator based on confidence thresholds.

Additional components: a reconciler for conflict resolution, long‑running branch rebase automation, Docker/K8s runtimes, and a plugin marketplace.

Getting Started

git clone https://github.com/ComposioHQ/agent-orchestrator.git
cd agent-orchestrator
pnpm install && pnpm build
ao init --tracker github --agent claude-code --runtime tmux
ao start

Running these commands launches the orchestrator, opens the dashboard, and lets the system handle code generation, PR creation, CI monitoring, and review routing while the human only intervenes for final decisions.

Diagram
Diagram
Diagram
Diagram
Timeline
Timeline
Bugbot
Bugbot
CI Failure
CI Failure
Architecture
Architecture
Activity Detection
Activity Detection
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

TypeScriptAI Agentsplugin architectureparallel executionagent orchestrationCI automationself‑improving systems
DeepNoMind
Written by

DeepNoMind

I’m Yu Fan, a tech leader with deep technical expertise and managerial vision. Formerly at Motorola, now at Mavenir, I’ve led teams for years, focusing on backend architecture and cloud-native solutions, staying abreast of AI and other frontier fields, and championing personal growth and lifelong learning.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.