Agents & Coding

Five months treating bugs like patients and coding agents like a medical team

Cockroach Labs reports its hospital-style agent pipeline merged over a million lines with seven reverts, but the discussion questions whether the elaborate roles are necessary and warns of process overhead.

120 points51 comments

Cockroach Labs describes MOLT Sinai, a five-month experiment that structures coding agents as a teaching hospital: GitHub issues are patients, labels trigger role-specific workflows, and agents must produce reviewed plans before code, preserve tests, and pass a discharge audit.

The company says the pipeline merged over a million lines with seven reverts, added IBM Db2 migration support in under two days for $4,172 in tokens, and later built much of its Migration Assistant. The post argues that slower, review-heavy agent workflows can be safer for database migrations than throughput-optimized swarms, while acknowledging bureaucracy, token waste, and non-converging review loops.

Key takeaways

  • The pipeline runs on GitHub Actions: issue labels trigger role-specific workflows, agents write structured chart notes with sentinels, and label transitions move work between Triage, Fellow, Review Attending, Discharge, and escalation paths.
  • Core rules require a reviewed treatment plan before code, reproduction of the bug, no weakening or skipping tests, I-PASS handoffs when stuck, and a Discharge Nurse audit that verifies review process rather than re-reviewing code.
  • Cockroach Labs says the mirror repo landed over 1M lines in five months with 7 reverts; the Db2 feature produced 32 sub-issues, 27 merged PRs, 55 send-backs, and 9 escalations, two to a human.
  • Db2 support took under two days and $4,172 in Claude tokens, versus Oracle support in 2024 at nine months and about $160K in engineering time; the post reports 164x faster and 38x cheaper.
  • The hospital consumed just over $135,000 in Claude tokens, about $84 per average issue, with issues spending one to two days, often waiting on human review; model routing evolved from Opus to Fable planning with Sonnet/Opus implementation and Fable escalation.
  • The Sinai framework repo has about 1,570 commits, 85% pipeline-authored; an audit found 25 skill files at ~100,000 words, 23% removable, and the Discharge Nurse loads ~21,800 words (~29,000 tokens) per run.

What people think

Ablation evidence for agent roles and hospital metaphor

Eridrus asks whether the authors ran ablation studies to separate what is actually useful from behavior the system merely works around. This questions the need for the proposed role and hospital-metaphor structure and asks for evidence isolating its contribution.

Comparison to OpenAI Symphony prompt

Eridrus compares the described setup to OpenAI's Symphony prompt, saying that at a high level it does the same thing except for model selection and does not need roles or hospital metaphors. This offers a competing framing for achieving similar agent coordination.

Bespoke agent factories in the software development lifecycle

james_marks asks how many teams are running factory-like agent systems on GitHub infrastructure, linking the discussion to GitHub Actions reliability. devin replies that many teams build bespoke factories with endless quality gates and additional agents to decide when to run actions; in their experience this often creates negative value and does not help teams ship faster than a more limited setup. This qualifies the approach's applicability by questioning its net benefit in real SDLC settings.

Auto-merge outpacing human verification

Prompted by kinduff's request for mistakes made before reaching a balanced solution, ajstorm says the first mistake was running in auto-merge mode: it produced results quickly, but at a rate the team could not human-verify, so they could not convince themselves the output was good. They switched to human approval mode to stop the momentum and review code in more detail. This identifies a verification bottleneck in autonomous operation.

DAG sibling communication and deferred scope

ajstorm reports that when issues were decomposed into a DAG, sibling issues would defer work assuming another sibling would handle it, and some work was dropped because siblings could not communicate. They added a deferred scope ledger and policy requiring any deferral to be commented in code and recorded with rationale and follow-up timing. This addresses a correctness and coordination limitation in the agent workflow.

Metaphor as efficient role encoding

finnborge frames the write-up as high-quality systems design and information theory, arguing that the 'teaching hospital' metaphor efficiently encodes complex roles and interactions. They suggest there may be room to leverage identities already abundant in training data to ritualistically encode social, civic, or cultural dynamics via prompts like 'act as though you're ___.'