Review Gates Turn Agent Swarms Into Accountable Systems

repoaitypescriptagent-loopsmulti-agentopencodetestingpersistence

coordinator review gates and integration smoke tests map directly to joelclaw agent loop reviewer and judge steps

Swarm Tools is a TypeScript multi-agent coordination layer for OpenCode, with swarm mail, hives, semantic memory, progress tracking, and worker coordination.

The interesting bit in pull request #55 isn’t the generated Changesets release plumbing. It’s what the release bundled: coordinator review tools, a mandatory post-worker checklist, and integration tests that exercise the full tool.execute() → store → database → response path.

That’s the move: agent work isn’t done when a worker says it’s done. The coordinator gets diff context, epic context, and a structured review prompt through swarm_review, then sends approved or needs_changes through swarm_review_feedback. Three rejections block the task. That’s not fancy. That’s the boring-ass control loop agents need if we want swarms to produce work we can trust.

The release also swaps hidden persistence state for explicit adapters: PGlite out, libSQL and Drizzle ORM in, with in-memory test helpers and cache clearing for isolation. That matters because the bug this release caught was exactly the kind that unit tests miss: every tool broke because the database path changed, and nothing tested the whole path.

Key Ideas

  • Coordinator review gates make multi-agent work inspectable before the next worker gets spawned.
  • swarm_review packages git diff plus epic context so review is tied to the actual goal, not just whatever the worker claims.
  • swarm_review_feedback creates a structured approval/rejection loop, with a three-strike blocked state instead of infinite churn.
  • Integration smoke tests run multiple swarm tools in sequence, catching broken tool → store → database wiring instead of only testing isolated functions.
  • Moving from PGlite to libSQL with Drizzle ORM removes implicit global state and makes persistence easier to test.
  • The pattern rhymes with joelclaw agent loops: worker output needs review, mechanical gates, and durable state transitions, not vibes.