ai newsMi., 25. Nov.
EilmeldungCan Claude’s storage webhooks miss an hour-long outage?

Run a Fleet of AI Coding Agents: From Browser Chatbots to Orca, t3code, and MCP Gateways

Originally published on tamiz.pro . The browser chatbot era of AI-assisted development is over. Asking a single model in a chat pane to "fix the bug" and then copy-pasting its patch into your editor was always a bottleneck: one context window, one serialized thought process, zero awareness of your

dev.toDienstag 07:02 · 24.11.11 Min. Lesezeit
Bild: dev.to

Posted on Nov 24 • Originally published at tamiz.pro

The browser chatbot era of AI-assisted development is over. Asking a single model in a chat pane to "fix the bug" and then copy-pasting its patch into your editor was always a bottleneck: one context window, one serialized thought process, zero awareness of your actual repository state. The teams shipping fastest today don't run one agent — they run a fleet of them, each scoped to a task, sharing the same toolchain, and coordinated by an orchestrator that knows which agent owns which file. This tutorial walks you through building exactly that: a local fleet built from Orca (the orchestrator), t3code (the executor CLI), and a Model Context Protocol (MCP) gateway that gives every agent the same tools, context, and safety rails.

A single coding agent, no matter how capable, is constrained by three hard limits:

A fleet solves all three by inverting the control flow. Instead of one agent that does everything, you get many agents that each do one thing, coordinated by an orchestrator that owns the repository state and the task graph. The model becomes a replaceable worker; the toolchain becomes a shared service; and the orchestrator becomes the only thing that touches the filesystem.

That's the architecture we're about to build. It's the same pattern that powers large-scale agent deployments in production CI systems, and you can run it on a single laptop.

Here's the system we're assembling, in words (no ASCII art needed — the data flow matters more than the boxes):

┌─────────┐ task graph ┌─────────┐ spawn ┌──────────┐ tools ┌─────────────┐ │ You │ ─────────────▶ │ Orca │ ────────▶ │ t3code #1│ ─────────▶ │ │ └─────────┘ │ (orch.) │ ├──────────┤ │ MCP │ │ │ │ t3code #2│ ─────────▶ │ Gateway │ │ │ ├──────────┤ │ (tools + │ │ │ │ t3code #N│ ─────────▶ │ perms) │ └─────────┘ └──────────┘ └─────────────┘ │ ▲ │ │ patches + reports ▼ │ ┌──────────┐ │ git + │ │ tests │ └──────────┘ Enter fullscreen mode Exit fullscreen mode The key architectural decision: agents are dumb, the gateway is smart, and Orca is the only writer. This is what makes the fleet safe to run in parallel.

# Orca — the orchestrator npm install -g @orca/orchestrator # t3code — the executor CLI npm install -g t3code # MCP gateway — the tool daemon npm install -g @mcp/gateway Enter fullscreen mode Exit fullscreen mode Verify everything is on the PATH:

orca --version t3code --version mcp-gateway --version Enter fullscreen mode Exit fullscreen mode 4. Step 1 — Stand Up the MCP Gateway The MCP gateway is the single source of truth for what agents are allowed to do. It exposes a JSON-RPC interface that any MCP client (t3code, Claude Desktop, Cursor, etc.) can connect to. Its job is to wrap filesystem, shell, and git operations behind a permission layer so that a misbehaving agent can't rm -rf your repo or exfiltrate your.env.

Create a config file, gateway.config.json:

{ "port": 8931, "host": "127.0.0.1", "tools": { "read_file": { "enabled": true, "allow_paths": [ "./src", "./tests", "./package.json", "./tsconfig.json" ] }, "write_file": { "enabled": true, "allow_paths": [ "./src" ], "max_file_size_kb": 256 }, "edit_file": { "enabled": true, "allow_paths": [ "./src" ], "require_diff": true }, "shell_exec": { "enabled": true, "allowlist": [ "npm test", "npm run lint", "npm run typecheck", "git status", "git diff", "git log --oneline -5" ], "denylist": [ "rm", "sudo", "curl", "wget", "chmod", "git push" ] }, "search": { "enabled": true, "max_results": 50 } }, "rate_limit": { "requests_per_minute": 120, "per_tool": { "shell_exec": 20 } }, "logging": { "level": "info", "file": "./.orca/gateway.log" } } Enter fullscreen mode Exit fullscreen mode Key things to notice:

mcp-gateway start --config./gateway.config.json Enter fullscreen mode Exit fullscreen mode You should see it bind to 127.0.0.1:8931. Test it with a quick MCP handshake:

# List available tools mcp-gateway tools --endpoint http://127.0.0.1:8931/mcp Enter fullscreen mode Exit fullscreen mode You should get back read_file, write_file, edit_file, shell_exec, and search. If you don't, check./.orca/gateway.log.

t3code is the headless worker. It takes a task (a natural-language or structured instruction), a working directory, and a gateway endpoint, and it returns a patch plus a structured report (JSON). It never talks to the model directly for tool calls — it routes them through the MCP gateway.

Create a task file, tasks/fix-login-validation.json:

{ "id": "fix-login-validation", "description": "Fix the login form so it validates email format before submitting and shows an inline error message.", "scope": [ "./src/components/LoginForm.tsx", "./src/utils/validate.ts" ], "acceptance": [ "npm run lint", "npm run typecheck", "npm test -- --runInBand src/components/__tests__/LoginForm.test.tsx" ], "model": { "provider": "anthropic", "model": "claude-sonnet-4-5", "temperature": 0.2 }, "max_iterations": 8 } Enter fullscreen mode Exit fullscreen mode Now run it as a single worker to verify the pipeline works end-to-end:

t3code run \ --task./tasks/fix-login-validation.json \ --cwd./my-app \ --gateway http://127.0.0.1:8931/mcp \ --out./output/fix-login-validation \ --api-key $ANTHROPIC_API_KEY Enter fullscreen mode Exit fullscreen mode What happens under the hood:

output/fix-login-validation/ ├── patch.diff # the final, applyable patch ├── report.json # structured result: pass/fail, iterations, tokens, tools used └── transcript.md # full agent conversation, for auditing Enter fullscreen mode Exit fullscreen mode 6. Step 3 — Define the Orca Orchestration Plan Orca is the brain. It takes a plan file that declares the fleet, the tasks, and their dependencies, then it spawns t3code workers, coordinates them, and merges results. It's the only component that writes to git.

version: 1 fleet: max_parallel: 3 worker: binary: t3code gateway: http://127.0.0.1:8931/mcp cwd:./my-app api_key_env: ANTHROPIC_API_KEY repo: branch: feature/agent-fleet base: main merge_strategy: squash require_clean: true tasks: - id: fix-login-validation depends_on: [ ] file:./tasks/fix-login-validation.json - id: add-login-tests depends_on: [ fix-login-validation ] file:./tasks/add-login-tests.json - id: refactor-auth-service depends_on: [ fix-login-validation ] file:./tasks/refactor-auth-service.json - id: run-full-suite depends_on: [ add-login-tests, refactor-auth-service ] accept: - npm test - npm run lint - npm run typecheck Enter fullscreen mode Exit fullscreen mode This plan declares a dependency graph: fix-login-validation is the root; add-login-tests and refactor-auth-service both depend on it and can run in parallel after it completes; run-full-suite waits for both.

Note the fleet.max_parallel: 3 — that's the concurrency cap. Orca will never spawn more than three t3code processes at once, even if the graph would allow it.

Now we run the whole thing. Orca handles branch creation, worker spawning, dependency resolution, and merging.

orca run --plan./orca.plan.yaml Enter fullscreen mode Exit fullscreen mode Orca's execution loop, in order:

Here's a sample of what Orca prints during a run:

[orca] plan validated: 4 tasks, 3 parallel workers [orca] branch created: feature/agent-fleet [orca] ready: fix-login-validation [orca] spawn worker: fix-login-validation (pid 4123) [orca] worker done: fix-login-validation (pass, 3 iterations, 1.2k tokens) [orca] ready: add-login-tests, refactor-auth-service [orca] spawn worker: add-login-tests (pid 4127) [orca] spawn worker: refactor-auth-service (pid 4131) [orca] worker done: add-login-tests (pass, 2 iterations) [orca] worker done: refactor-auth-service (pass, 5 iterations) [orca] ready: run-full-suite [orca] running acceptance: npm test && npm run lint && npm run typecheck [orca] all tasks passed. merging into feature/agent-fleet [orca] done: 4/4 tasks passed, 1 commit created Enter fullscreen mode Exit fullscreen mode 8. Step 5 — Task Routing and Parallel Execution The simple DAG above is a good start, but real fleets need task routing — the ability to send a task to a specific worker profile based on its nature. You might want a fast worker for small fixes, a deep worker for refactors, and a readonly worker for analysis that never writes.

Extend your Orca plan with worker profiles:

fleet: profiles: fast: model: claude-haiku-4-5 temperature: 0.0 max_iterations: 3 timeout_minutes: 5 tools: [ read_file, search, shell_exec ] deep: model: claude-sonnet-4-5 temperature: 0.2 max_iterations: 12 timeout_minutes: 30 tools: [ read_file, write_file, edit_file, search, shell_exec ] readonly: model: claude-sonnet-4-5 temperature: 0.0 max_iterations: 2 timeout_minutes: 10 tools: [ read_file, search ] read_only: true tasks: - id: fix-login-validation profile: fast file:./tasks/fix-login-validation.json - id: refactor-auth-service profile: deep file:./tasks/refactor-auth-service.json - id: audit-deps profile: readonly file:./tasks/audit-deps.json Enter fullscreen mode Exit fullscreen mode Now Orca routes each task to the right profile. The readonly profile is particularly important: it connects to the MCP gateway with a read-only session (the gateway rejects any write_file or edit_file call), so you can run a whole class of agents that literally cannot modify your code.

To enforce read-only at the gateway level, add a session concept to the gateway config:

{ "sessions": { "readonly": { "allow": [ "read_file", "search" ], "deny": [ "write_file", "edit_file", "shell_exec" ] }, "standard": { "allow": [ "read_file", "search", "write_file", "edit_file", "shell_exec" ] } } } Enter fullscreen mode Exit fullscreen mode And in the t3code task, request a session:

{ "id": "audit-deps", "description": "Audit for unused dependencies and outdated versions.", "session": "readonly", "model": { "provider": "anthropic", "model": "claude-sonnet-4-5" } } Enter fullscreen mode Exit fullscreen mode 9. Step 6 — Observability and Safety Rails A fleet running in parallel is only as good as your ability to see what it's doing and stop it when it goes wrong. Here's the minimum viable observability stack for an Orca fleet.

Orca writes every event to./.orca/events.jsonl — one JSON object per line. Each event has a task_id, worker_pid, timestamp, event_type, and payload. You can tail it in real time:

tail -f./.orca/events.jsonl | jq -c 'select(.event_type == "tool_call")' Enter fullscreen mode Exit fullscreen mode Metrics Orca exposes a Prometheus endpoint by default on 127.0.0.1:9090/metrics. Useful gauges:

curl -s http://127.0.0.1:9090/metrics | grep orca_ Enter fullscreen mode Exit fullscreen mode Key metrics to watch:

If an agent goes rogue (infinite loop, runaway file edits), you can stop the whole fleet with a single command:

orca stop --plan./orca.plan.yaml Enter fullscreen mode Exit fullscreen mode Orca sends SIGTERM to all workers, and the MCP gateway drops all active sessions. Because the gateway is the only thing that can write, this is a hard stop — no agent can keep writing after the gateway closes.

Before Orca merges any worker's patch, it runs a pre-merge gate. You can define custom gate commands in the plan:

repo: pre_merge_gates: - npx prettier --check. - npx eslint --max-warnings 0. - npm run typecheck Enter fullscreen mode Exit fullscreen mode If any gate fails, Orca rejects that task's patch and marks the task failed, rather than merging broken code.

Running a fleet in production (or even on a busy repo) surfaces edge cases that a single agent never hits. Here's how to handle the big ones.

Two agents editing overlapping files is the classic fleet failure. Mitigate it three ways:

The deep profile with max_iterations: 12 will eventually blow the context window. Handle it with checkpointing: t3code writes a snapshot of the conversation to output/<task-id>/checkpoint.json after every iteration. If the context fills up, t3code starts a fresh conversation with a compressed summary of the prior state. Enable it per-task:

{ "id": "refactor-auth-service", "checkpoint": { "enabled": true, "interval": 2, "compress": true } } Enter fullscreen mode Exit fullscreen mode Model failures and retries LLM APIs are flaky. Orca has built-in retry with exponential backoff:

fleet: retry: max_attempts: 3 backoff_ms: 2000 backoff_multiplier: 2 retry_on: [ "rate_limit", "timeout", "server_error" ] Enter fullscreen mode Exit fullscreen mode Dockerizing workers for isolation For real production safety, run each t3code worker in a container with a read-only filesystem and only the repo mounted at a specific path. A minimal Dockerfile:

FROM node:20-slim RUN npm install -g t3code WORKDIR /workspace COPY. /workspace CMD [ "t3code", "run", "--task", "/tasks/task.json", "--cwd", "/workspace", "--gateway", "http://gateway:8931/mcp" ] Enter fullscreen mode Exit fullscreen mode Then point Orca's worker config at a container runtime instead of a local binary:

fleet: worker: runtime: docker image: my-agent-worker:latest network: host mounts: -./my-app:/workspace Enter fullscreen mode Exit fullscreen mode Don't let agents push This is the most important rule: the MCP gateway's shell_exec denylist must always contain git push. Agents can commit locally, but only Orca (or your CI) should ever push to a remote. This prevents an agent from accidentally pushing broken code or, worse, pushing to main.

If you want to take this further and see how these patterns scale to full CI pipelines and release automation, check out Tamiz's Insights for deeper coverage of agent-driven development workflows.

Because the gateway is the security boundary and the audit trail. When agents call tools directly, you have no central place to enforce permissions, rate limits, or path allowlists — and no way to log every tool call. The gateway gives you one choke point where you can say "this agent can only read, that agent can only write to src/, nobody can run rm ". It's the difference between a fleet you can trust and a fleet you're praying about.

Yes. Each task's model.provider field is independent, so you can have one worker on Anthropic, one on OpenAI, and one on a local Ollama model, all in the same plan. The MCP gateway and Orca don't care which provider a worker uses — they only see the tool calls and the resulting patch. This is useful for cost optimization: route simple tasks to a cheap fast model and complex refactors to a more capable one.

By default, Orca marks the task as failed, does not run any downstream tasks that depend on it, and leaves the repo in a clean state (it rolls back any partial changes from that task's patch). You can override this per-task with continue_on_error: true if you want the DAG to proceed anyway, but in practice you should let failures halt the dependent chain — a refactor built on top of a broken fix is usually worse than no refactor at all.

Quelle: dev.to (dev.to). Original öffnen