Skip to content

Add swarm sessions: durable agent pools, scoped messaging, and Modal-backed workers - #1105

Merged
16francej merged 9 commits into
mainfrom
feat/swarm-sessions
Sep 14, 2026
Merged

16francej merged 9 commits into
mainfrom
feat/swarm-sessions

Conversation

@ReganBell

@ReganBell ReganBell commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Implements swarm sessions per Leo's design doc: durable agent pools ("swarms") rooted in a session, scoped worker messaging, and Modal-backed private worker sandboxes. Explicitly excludes the filesystem snapshot/copy/restore portion of the design.

What's included

  • src/swarms/ — swarm service, durable store, and lifecycle (reserve → provision → ready → deliver → cleanup) with bounded reconciliation sweeps, separate resource/delivery pools, and per-swarm advisory locking.
  • API surface in src/api/routes/swarms.ts with action-specific field allowlists; agent operations require an active capability run (matching thread, actor, scope, unexpired lease).
  • Orchestrator integration: approvals and security-screen grants are session-isolated — a root-session grant never authorizes a worker.
  • Worker sandbox routing honors the recorded per-worker sandboxId (no silent fallback to the scope default).
  • docs/swarms.md.

Validation

  • 397 repo tests pass (swarms, swarm-api, swarm-modal, swarm-orchestrator, sandbox-resources, sessions-background-activity, orchestrator, sandbox-routing, worker-reaper, run-result-delivery, background-exec-broker, modal-sandbox, durable-stores, postgres-swarms), including new race regressions against real Postgres.
  • Static checks pass: typecheck, typecheck:contract, lint, lint:ox, lint:knip; prettier and git diff --check clean.
  • Four adversarial review rounds against the combined diff, each in a fresh context, with independent read-only probe batteries (memory + real Postgres). Rounds 1–3 produced nine findings (capability authority, approval isolation, roster gating, sandbox routing, sweep bounds/starvation, identity-field rejection, pending-query single-flight, docs, and a reconciliation-timeout rollback race); all nine are fixed and re-verified at this HEAD. Round 4 adjudicated all nine FIXED with no new major findings and approved.
  • Modal provisioning is mocked in tests; no real provisioning was performed.

QA status

Slack/dev-instance QA is blocked: no dev Slack pool credentials, no Modal tokens, and dev-instance boot failed on missing model creds. Live end-to-end QA on a dev instance should happen before merge.

Draft until live QA and human review.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

@16francej
16francej force-pushed the feat/swarm-sessions branch 2 times, most recently from 3c51680 to aedfc6c Compare September 12, 2026 08:11
@16francej
16francej marked this pull request as ready for review September 14, 2026 04:57
@16francej
16francej merged commit e0b8686 into main Sep 14, 2026
20 checks passed
@16francej
16francej deleted the feat/swarm-sessions branch September 14, 2026 06:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants