← Return to studyEsc

FROM THE BOOKSHELF / A PAGE TO KEEP

AI 洞察
42 分钟

Stop Counting Agents. Start Counting Who Decides.

胡新宇

Published on 2026-07-23

Cursor's internal Agent swarm ran the same SQLite rewrite twice and got 70,000 conflicts the first time, 47 the second. The hardware and the models did not change. The org chart did. Here is what every team shipping coding Agents should steal on Monday.

Cursor gave a thousand Agents one job: rewrite SQLite in Rust from a PDF. The legacy swarm logged 70,000 merge conflicts in two hours and crashed. The redesigned swarm logged 47 conflicts on the most-edited file and passed 80% of retained SQL tests in four hours.

The two runs used the same models, the same time budget, and the same 835-page SQLite spec. The only difference was the structure: who decides what, how shared memory is written, and what happens when two Agents touch the same line at the same time.

The bottleneck of an Agent swarm is not the model. It is the org chart.

The 70,000-Conflict Run

The setup was deliberately brutal. The swarm received:

  • The 835-page SQLite documentation
  • No source code, no test suite, no SQLite binary, no internet
  • A single goal: produce a working SQL database in Rust

The legacy swarm was modeled on "more parallelism = more throughput". A peak run had 1,173 agents editing the same file — the SQL parser — with no coordination beyond a shared commit log. Within two hours the system had accumulated over 70,000 merge conflicts and was suspended. The output was 54 Rust crates, three of which were competing SQL parsers that all individually worked but could not coexist.

The redesigned swarm ran the same task with the same models. The output stabilized at 9 Rust crates and reached 80% SQL test pass-rate in four hours using Grok 4.5. The single most-edited file saw only 47 authors.

The hardware, the models, and the spec did not change. The org chart did.

Planner/Worker task tree with exclusive decision authority

The Deep Mechanism: Who Decides, Not Who Codes

The new swarm has exactly two roles.

Planner owns a subtree of the task tree. It makes design decisions — interfaces, data structures, module boundaries — and dispatches bounded work to Workers. Worker is a faster, cheaper model that just implements one piece. Every Planner subtree is forbidden from making a decision another Planner subtree already owns.

This rule sounds like organization hygiene. It solves a concrete code disaster. Two Planners who do not know about each other will independently write two SQL parsers, two query planners, two transaction managers. Each one works. Together they are two worlds pretending to be one program.

The task tree in this design is not a work-breakdown structure. It is a decision tree. Its job is to make sure no design question is answered twice. Once authority is exclusive, Workers do not have to re-derive global intent on every commit.

This is also why frontier-model Planners matter more than they look. A Planner's value is not the code it writes. It is the ambiguity it removes before cheaper Workers touch the file. A cheap Worker with a vague spec will rewrite the same file four times. A cheap Worker with a tight spec will write it once.

The Hidden Infrastructure Nobody Talks About

Cursor's swarm hits a peak of roughly 1,000 commits per second. Git's lock-based merge queue — fine for ten engineers — becomes a toll booth at that throughput. So Cursor built a custom VCS. Every modification lands there first; conflicts surface immediately; when two Workers collide on the same block, a third-party neutral Agent adjudicates the merge instead of letting either side overwrite the other.

Design decisions cannot live inside a Planner's chat log. Every Agent writes its decisions into a shared design document. Code that depends on those decisions carries compile-checked references back to the document. When two Planners disagree, the document is reconciled first and the new decisions propagate along the reference graph into the code.

There is also a Field Guide — a markdown index (index.md) the Agents curate themselves, with a strict line budget. It is injected into every Agent's startup context. What is worth remembering for the whole swarm, versus what should stay local to a single task, is a judgment call the Agents make.

Draw the whole system as a company. The task tree is the org chart. The shared design doc is the meeting notes. The custom VCS is the conflict room. The third-party Agent is the merge mediator. The Field Guide is the employee handbook that updates itself.

The product is not the Agents. The product is the company that runs them.

The Economics: Same Spec, 8x the Bill

Cursor tested four model-role combinations on the same SQLite spec and time budget. The total cost ranged from $1,339 to $10,565. Same outcome class, almost an order of magnitude apart.

The asymmetry is in the token mix. Workers always consume at least 69% of total tokens, often more than 90%. The all-GPT-5.5 run — one frontier model handling both planning and execution — burned $9,373 in Worker tokens alone. A run that used a frontier Planner with a small cheap Worker came in at the low end.

The principle is simple and most teams will get it backwards: spend the expensive model on disambiguation, spend the cheap model on execution. Compare total spec cost, not per-token price. A cheap Worker that rewrites the same file four times will eat the savings from the cheaper per-token rate and then some.

The cost spread is also a warning about the "Agents will get cheaper" narrative. Agents get cheaper per token, but Agents also generate more tokens to compensate for weak decisions. The bill can still go up.

Cost spread across four model-role combinations for the same spec

The End State Cursor Is Betting On

The progression Cursor names is honest about the unit of work at each level:

  • Autocomplete: a line of code
  • Early coding models: a code block
  • Single coding Agent: a file or feature
  • Swarm: a spec

The SQLite experiment is simulating that final step. The team hands the swarm 835 pages of prose and expects the swarm to compile intent into a task tree, design decisions, and code. A traditional compiler preserves semantics at every step. A swarm preserves probabilities — and at every step something has to patch the reliability gap: the task tree, the shared document, the custom VCS, the test suite.

Before anyone scales this, three caveats matter:

  1. This is one team's internal experiment. Different runs used different test harnesses. Some code was not deeply audited.
  2. The 70,000-vs-47 result depends on the Planner/Worker split. Without that split, the cheap-Worker savings probably do not materialize.
  3. Lobsters migrated to SQLite this month — proof that SQLite is still load-bearing infrastructure for the indie web — but a swarm rewriting it from a PDF is a different problem class than running it.

What to Steal Today

You do not have Cursor's custom VCS, but you can copy the decision structure on Monday morning:

  • Give every key design decision a single owner. Two owners who do not talk will produce two competing SQL parsers, two competing state machines, two competing auth flows. The cost of the conflict is paid by the cheap Workers downstream.
  • Make the shared document the contract. Code that depends on a design decision should reference the document. If the document changes, the reference breaks at compile time, not at customer time.
  • Measure by test progress and conflict trends, not by commit count or active-Agent count. Commit count goes up when the org chart is broken; test progress goes up when it works.
  • Bill by Planner/Worker contribution, not by raw tokens. The expensive model earns its keep by removing ambiguity. The cheap model earns its keep by executing cleanly. If the cheap model is reworking, the model is not cheap — it is just slow in disguise.

The whole lesson of the SQLite run can fit on one line. Before you scale the swarm, scale the org chart.


References

  • Cursor. Agent swarms and the new model economics. cursor.com/blog/agent-swarm-model-economics
  • Cursor. minisqlite code repository. github.com/cursor/minisqlite
  • Reporting summary: NLPer, Cursor 让上千个 Agent 组成智能体蜂群重写 SQLite,先打了七万次架, 2026-07-22.
  • Lobsters, lobste.rs is now running on SQLite, 2026-07-14.
#AI Agent#Agent#AI工程#IDE