跪拜 Guibai
← All articles
Artificial Intelligence · Agent · Backend

oh-my-pi: An Engineering-Grade AI Coding Tool That Runs 8 Agents in Parallel

By 独立开发阿平 ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

Single-agent coding tools routinely corrupt files during multi-module refactoring, hallucinate fixes, and leave no audit trail. omp's multi-agent architecture with isolated workspaces, dual review, and structured JSON output turns AI-assisted refactoring from a gamble into an engineering process with traceable commits, rollback capability, and a measurable drop in hallucination rate.

Summary

Unlike single-agent conversational coding tools, omp routes every task through a main agent that decomposes requirements, assigns work to specialized sub-agents, and merges results. Each sub-agent operates in an isolated workspace, eliminating file conflicts during parallel execution. Sub-agents communicate via IRC-style messaging to handle task dependencies, and the system supports both serial pipelines and parallel fan-out workflows. A Swarm mode extends this to persistent, unattended DAG workflows embeddable in CI pipelines.

Hallucination reduction relies on a triple safety net: dual-layer code review by reviewer and oracle agents, real runtime debugging data via DAP protocol attachment, and LSP-based syntax verification. All sub-agent output is structured JSON — modified file lists, exported interfaces, elapsed time, and cost — so automated tooling can consume results directly without parsing natural language. Hash-anchored editing prevents the indentation corruption and silent overwrites common with single-agent tools.

omp ships as a single Rust binary with built-in ripgrep, persistent shell sessions, and a browser scraper. It supports 40+ model providers with automatic routing that sends lightweight tasks to cheap models and reserves expensive ones for core coding. The tool reads existing .cursor/rules and .clinerules files, includes 32 built-in tools for Git, web scraping, PDF parsing, and GitHub interaction, and runs natively on Windows, macOS, and Linux — including ARM64 on Raspberry Pi.

Takeaways
All tasks enter through a single main agent that decomposes requirements and dispatches work to specialized sub-agents; users never interact with sub-agents directly.
Eight built-in roles handle distinct phases: scout maps the codebase, researcher fetches external docs, planner produces file-level plans, worker writes code, reviewer checks it, oracle performs a second independent review, context-builder compresses long sessions, and delegate handles ad-hoc tasks.
Each sub-agent works in an isolated filesystem tree — APFS snapshots on macOS, Btrfs/ZFS reflinks or OverlayFS on Linux, ProjFS on Windows — so parallel modifications never conflict.
Sub-agents output structured JSON with modified file lists, exported interfaces, elapsed time, and cost, eliminating the need to parse natural language summaries.
Sub-agents communicate via IRC-style point-to-point messaging to handle task dependencies without forcing serial execution.
Hash-anchored editing prevents indentation corruption and refuses to overwrite manually changed files without confirmation.
DAP protocol integration attaches a real debugger for runtime breakpoints, single-stepping, variable inspection, and crash stack capture — not static code guessing.
LSP and AST-based semantic modification syncs renames, import paths, and cross-file dependencies across the entire project for TypeScript, Go, Python, and Java.
Swarm mode uses YAML-defined DAGs for persistent, unattended multi-agent workflows that can run in CI pipelines.
Automatic model routing sends research and search tasks to cheap models and reserves expensive ones for core coding, with explicit routing rules and failover.
Installation is a single curl or PowerShell command; the Rust binary includes ripgrep, persistent shells, and a browser scraper with no external dependencies.
The tool reads existing .cursor/rules and .clinerules files and provides 32 built-in tools plus a terminal slash-command system.
Learning curve is steep — 1–2 days to master LSP config, DAP debugger setup, sub-agent orchestration, and model routing rules.
Niche language support is weak; LSP-dependent syntax-level modifications degrade for less common languages.
Resource overhead is higher than lightweight CLI agents when running multiple parallel sub-agents and persistent debugging sessions.
Conclusions

omp's architecture treats AI coding as an engineering discipline rather than a conversation: structured JSON output, isolated workspaces, dual review, and hash-anchored edits are mechanisms borrowed from build systems and CI pipelines, not chatbot UX patterns.

The single-entry-point design solves the accountability problem that plagues multi-agent systems — when the main agent alone dispatches and merges, there is no ambiguity about which agent owns a mistake.

Real debugging via DAP protocol attachment is a category difference from static analysis. Most AI coding tools guess at bugs; omp runs the code and inspects runtime state, which matters most for concurrency bugs, memory issues, and crash forensics.

The steep learning curve and terminal-native design position omp as a power tool for engineers doing large-scale refactoring, not a replacement for lightweight conversational coding assistants. The author's own workflow — small changes by hand, large refactors through omp — reflects this.

Hash-anchored editing that halts and asks for confirmation before overwriting manual changes is a safety feature that single-agent tools lack entirely, and it addresses one of the most common failure modes: silent destruction of work the developer did outside the tool.

Concepts & terms
DAP (Debug Adapter Protocol)
A protocol that allows development tools to communicate with debuggers in a standard way. omp uses it to attach a real debugger, set breakpoints, step through code, and inspect runtime variables and call stacks — going beyond static code analysis to find bugs using actual execution data.
LSP (Language Server Protocol)
A protocol that provides language-specific features like auto-completion, go-to-definition, and diagnostics. omp uses LSP for syntax-level code verification and semantic modifications — when renaming a function, it updates all references and import paths across the project, not just text-matching the name.
Hash-anchored editing
A technique that identifies code locations by content hash rather than line numbers. This prevents the indentation corruption, context misalignment, and silent overwrites common when AI tools modify files using brittle line-number or text-pattern references.
Swarm mode
An omp extension that orchestrates multi-agent workflows using YAML-defined Directed Acyclic Graphs (DAGs). It can run persistently in the background without human supervision and integrates into CI pipelines for automated batch engineering tasks.
Fan-out
A parallel execution pattern where a single task is split and dispatched to multiple workers simultaneously. omp uses fan-out for batch operations like adding frontend components or completing interfaces across many files at once.
Source: juejin.cn ↗ Google Translate ↗ Backup ↗