swarm-local-e2e
Skill1.1k starsChanged 2 months agoMITView on GitHub
Guide for running local E2E tests with API server, Docker lead/worker containers, task creation, log verification, UI dashboard, and cleanup
- Reads credentials
- Sends data out
Adopted by
Steady: 0 new projects took it in the last 4 weeks, none the 4 weeks before.thin data
Who's talking about desplega-ai/agent-swarm
- A Hacker News story“Show HN: Agent Swarm – Multi-agent self-learning teams (OSS)”Hacker News · Feb 26, 2026 · 63 points
- A Hacker News story“Agent-swarm: How to burn your Claude Code Max sub”Hacker News · Dec 23, 2025 · 3 points
- @creatuluw.bsky.social“I do think apps like these are interesting. My question is what exactly you need from humans as input on …”Bluesky · Oct 28, 2026 · 1 likes
- A Hacker News story“Agent Swarm: OSS multiplayer AI for your company”Hacker News · Oct 9, 2026 · 1 points
- A Hacker News story“TLA+ helped us fix and10 issues in our OSS project”Hacker News · Sep 29, 2026 · 1 points
The biggest 5 of 57 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 57
Talked about on GitHub, Hacker News and Bluesky (57 times).
On GitHub · 50
- Jan 15, 2026Add environment variable support for configurable database path — desplega-ai/ai-toolbox1 reaction
- Jan 15, 2026feat(ai-tracker): Add AI_TRACKER_DB_PATH environment variable support — desplega-ai/ai-toolbox1 reaction
- Nov 10, 2026agent-skills.github.desplega-ai.agent-swarm: 2.9.1 → 2.10.0 — sudosubin/agents.nix0 reactions
- Nov 9, 2026codex-marketplaces.github.desplega-ai.agent-swarm: 2.9.0 → 2.9.1 — sudosubin/agents.nix0 reactions
- Nov 9, 2026agent-skills.github.desplega-ai.agent-swarm: 2.9.0 → 2.9.1 — sudosubin/agents.nix0 reactions
45 more on GitHub
- Nov 8, 2026agent-skills.github.desplega-ai.agent-swarm: 2.8.3 → 2.9.0 — sudosubin/agents.nix0 reactions
- Nov 8, 2026codex-marketplaces.github.desplega-ai.agent-swarm: 2.8.3 → 2.9.0 — sudosubin/agents.nix0 reactions
- Nov 7, 2026agent-skills.github.desplega-ai.agent-swarm: 2.8.2 → 2.8.3 — sudosubin/agents.nix0 reactions
- Nov 7, 2026codex-marketplaces.github.desplega-ai.agent-swarm: 2.8.2 → 2.8.3 — sudosubin/agents.nix0 reactions
- Nov 6, 2026agent-skills.github.desplega-ai.agent-swarm: 2.8.1 → 2.8.2 — sudosubin/agents.nix0 reactions
- Nov 6, 2026codex-marketplaces.github.desplega-ai.agent-swarm: 2.8.1 → 2.8.2 — sudosubin/agents.nix0 reactions
- Nov 5, 2026agent-skills.github.desplega-ai.agent-swarm: 2.8.0 → 2.8.1 — sudosubin/agents.nix0 reactions
- Nov 5, 2026codex-marketplaces.github.desplega-ai.agent-swarm: 2.8.0 → 2.8.1 — sudosubin/agents.nix0 reactions
- Nov 5, 2026agent-skills.github.desplega-ai.agent-swarm: 2.7.10 → 2.8.0 — sudosubin/agents.nix0 reactions
- Nov 5, 2026codex-marketplaces.github.desplega-ai.agent-swarm: 2.7.10 → 2.8.0 — sudosubin/agents.nix0 reactions
- Nov 4, 2026agent-skills.github.desplega-ai.agent-swarm: 2.7.9 → 2.7.10 — sudosubin/agents.nix0 reactions
- Nov 4, 2026codex-marketplaces.github.desplega-ai.agent-swarm: 2.7.9 → 2.7.10 — sudosubin/agents.nix0 reactions
- Nov 3, 2026codex-marketplaces.github.desplega-ai.agent-swarm: 2.7.8 → 2.7.9 — sudosubin/agents.nix0 reactions
- Nov 3, 2026agent-skills.github.desplega-ai.agent-swarm: 2.7.8 → 2.7.9 — sudosubin/agents.nix0 reactions
- Nov 3, 2026Add: Agent Swarm — sandbaseai/awesome-agent-runtime0 reactions
- Nov 3, 2026Add Agent Swarm — backblaze-labs/awesome-agent-infrastructure0 reactions · 2 comments
- Nov 2, 2026codex-marketplaces.github.desplega-ai.agent-swarm: 2.7.7 → 2.7.8 — sudosubin/agents.nix0 reactions
- Nov 2, 2026agent-skills.github.desplega-ai.agent-swarm: 2.7.7 → 2.7.8 — sudosubin/agents.nix0 reactions
- Nov 1, 2026codex-marketplaces.github.desplega-ai.agent-swarm: 2.7.6 → 2.7.7 — sudosubin/agents.nix0 reactions
- Nov 1, 2026agent-skills.github.desplega-ai.agent-swarm: 2.7.6 → 2.7.7 — sudosubin/agents.nix0 reactions
- Oct 31, 2026codex-marketplaces.github.desplega-ai.agent-swarm: 2.7.5 → 2.7.6 — sudosubin/agents.nix0 reactions
- Oct 31, 2026agent-skills.github.desplega-ai.agent-swarm: 2.7.5 → 2.7.6 — sudosubin/agents.nix0 reactions
- Oct 30, 2026agent-skills.github.desplega-ai.agent-swarm: 2.7.4 → 2.7.5 — sudosubin/agents.nix0 reactions
- Oct 30, 2026codex-marketplaces.github.desplega-ai.agent-swarm: 2.7.4 → 2.7.5 — sudosubin/agents.nix0 reactions
- Oct 29, 2026codex-marketplaces.github.desplega-ai.agent-swarm: 2.7.3 → 2.7.4 — sudosubin/agents.nix0 reactions
- Oct 29, 2026agent-skills.github.desplega-ai.agent-swarm: 2.7.3 → 2.7.4 — sudosubin/agents.nix0 reactions
- Oct 29, 2026codex-marketplaces.github.desplega-ai.agent-swarm: 2.7.2 → 2.7.3 — sudosubin/agents.nix0 reactions
- Oct 29, 2026agent-skills.github.desplega-ai.agent-swarm: 2.7.2 → 2.7.3 — sudosubin/agents.nix0 reactions
- Oct 28, 2026codex-marketplaces.github.desplega-ai.agent-swarm: 2.7.1 → 2.7.2 — sudosubin/agents.nix0 reactions
- Oct 28, 2026agent-skills.github.desplega-ai.agent-swarm: 2.7.1 → 2.7.2 — sudosubin/agents.nix0 reactions
- Oct 27, 2026agent-skills.github.desplega-ai.agent-swarm: 2.7.0 → 2.7.1 — sudosubin/agents.nix0 reactions
- Oct 27, 2026codex-marketplaces.github.desplega-ai.agent-swarm: 2.7.0 → 2.7.1 — sudosubin/agents.nix0 reactions
- Oct 27, 2026agent-skills.github.desplega-ai.agent-swarm: 2.6.0 → 2.7.0 — sudosubin/agents.nix0 reactions
- Oct 27, 2026codex-marketplaces.github.desplega-ai.agent-swarm: 2.6.0 → 2.7.0 — sudosubin/agents.nix0 reactions
- Oct 26, 2026codex-marketplaces.github.desplega-ai.agent-swarm: 2.5.4 → 2.6.0 — sudosubin/agents.nix0 reactions
- Oct 26, 2026agent-skills.github.desplega-ai.agent-swarm: 2.5.4 → 2.6.0 — sudosubin/agents.nix0 reactions
- Oct 25, 2026codex-marketplaces.github.desplega-ai.agent-swarm: 2.5.3 → 2.5.4 — sudosubin/agents.nix0 reactions
- Oct 25, 2026agent-skills.github.desplega-ai.agent-swarm: 2.5.3 → 2.5.4 — sudosubin/agents.nix0 reactions
- Oct 24, 2026codex-marketplaces.github.desplega-ai.agent-swarm: 2.5.2 → 2.5.3 — sudosubin/agents.nix0 reactions
- Oct 24, 2026agent-skills.github.desplega-ai.agent-swarm: 2.5.2 → 2.5.3 — sudosubin/agents.nix0 reactions
- Oct 23, 2026codex-marketplaces.github.desplega-ai.agent-swarm: 2.5.1 → 2.5.2 — sudosubin/agents.nix0 reactions
- Oct 23, 2026agent-skills.github.desplega-ai.agent-swarm: 2.5.1 → 2.5.2 — sudosubin/agents.nix0 reactions
- Oct 23, 2026codex-marketplaces.github.desplega-ai.agent-swarm: 2.5.0 → 2.5.1 — sudosubin/agents.nix0 reactions
- Oct 23, 2026agent-skills.github.desplega-ai.agent-swarm: 2.5.0 → 2.5.1 — sudosubin/agents.nix0 reactions
- Oct 22, 2026codex-marketplaces.github.desplega-ai.agent-swarm: 2.4.6 → 2.5.0 — sudosubin/agents.nix0 reactions
On Hacker News · 4
- Feb 26, 2026Show HN: Agent Swarm – Multi-agent self-learning teams (OSS)63 points · 46 comments
- Dec 23, 2025Agent-swarm: How to burn your Claude Code Max sub3 points · 1 comment
- Oct 9, 2026Agent Swarm: OSS multiplayer AI for your company1 point · 3 comments
- Sep 29, 2026TLA+ helped us fix and10 issues in our OSS project1 point · 1 comment
On Bluesky · 3
- Oct 28, 2026I do think apps like these are interesting. My question is what exactly you need from humans as input on what scale to get big benefits… — @creatuluw.bsky.social1 likes and repost
- Feb 26, 2026Show HN: Agent Swarm – Multi-agent self-learning teams (OSS) L: https://github.com/desplega-ai/agent-swarm C:… — @hnws.bsky.social1 likes and repost · 1 reply
- Jan 5, 2026I've been working on some hooks. Mainly on how many attempts you have at prompting. I would love to open source it if people are willing to… — @ecura.bsky.social0 likes and reposts · 1 reply
In this repository5 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- docs-site/CLAUDE.mdCLAUDE.md
- dashboard-uiSkill
- onboarding-qaSkill
- agent-swarmSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
25 rules. About 0 are common, 12 are distinctive, and 13 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈12
Distinctive · estimate
This author's own choices. Worth a look.
13
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Run full end-to-end tests of the agent swarm locally with a real API server and Docker containers.
- Distinctive: line 16
Automated change verification: After implementing changes that touch the API, runner, polling, task lifecycle, session logs, Docker …
- Distinctive: line 18
Session log changes: Run two sequential tasks on the same agent, verify log isolation (unique sessionIds, no cross-contamination)
- Distinctive: line 20
UI changes: Start the dashboard, use agent-browser to verify rendering
- Distinctive: line 21
API endpoint changes: Call the endpoint directly and verify the response
- Very specific: line 34
Check .env for the configured port — do not assume 3013:
- Very specific: line 40
Use this value as $PORT throughout.
- Distinctive: line 48
If they don't match, update them before starting containers.
- Very specific: line 64
Keep DESPLEGA_TELEMETRY_ENV=test on every API and container you boot for a test.
- Distinctive: line 76
Use a unique container name to avoid conflicts with other worktrees (e.g.
- Distinctive: line 89
Wait ~15s, then verify:
- Very specific: line 95
If port 3201 is taken by another worktree, pick a different host port (e.g.
- Very specific: line 122
Should show both lead and worker registered as idle.
- Very specific: line 136
Important: Use agentId (not assignedTo) to assign tasks.
- Distinctive: line 187
Start the dashboard to visually verify tasks, logs, and agent status:
- Distinctive: line 194
If the UI port is taken by another worktree, start on an alternate:
- Very specific: line 203
Use agent-browser to automate UI checks (never qa-use unless explicitly asked):
- Very specific: line 247
Verify task was created with agentId (not assignedTo) — wrong param silently creates an unassigned task
- Very specific: line 248
Check task status isn't already in_progress (e.g.
- Very specific: line 253
Check worker has capacity: docker logs <container> 2>&1 | grep "capacity"
- Distinctive: line 254
If "At capacity" — a previous task is still running.
- Very specific: line 264
If another worktree is running, set a different PORT in .env and update MCP_BASE_URL in .env.docker* to …
- Very specific: line 268
Check claudeSessionId is set on the task: GET /api/tasks/<id> should show it
- Very specific: line 269
If logs were stored under wrong taskId, check the session_logs table directly
- Distinctive: line 275
Use simple tasks like "Say hello" for E2E tests.
≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Local E2E Testing Guide
Run full end-to-end tests of the agent swarm locally with a real API server and Docker containers.
When to Use This Skill
This skill should be invoked in two modes:
- User-requested QA: The user asks you to run E2E tests, verify a feature, or QA a specific flow. Follow the steps below targeting what they asked for.
- Automated change verification: After implementing changes that touch the API, runner, polling, task lifecycle, session logs, Docker entrypoint, or worker/lead behavior — use this skill proactively to verify the changes work end-to-end. Determine what's testable based on the diff:
- Task lifecycle changes (poll, runner, store-progress): Create assigned + pool tasks, verify they complete and have correct logs
- Session log changes: Run two sequential tasks on the same agent, verify log isolation (unique sessionIds, no cross-contamination)
- Docker / entrypoint changes: Build image, start containers, verify boot logs and registration
- UI changes: Start the dashboard, use agent-browser to verify rendering
- API endpoint changes: Call the endpoint directly and verify the response
You do not need to run every step — pick the subset relevant to the changes being tested.
Prerequisites
- OrbStack or Docker Desktop running (
open -a OrbStackif needed) .envwithAPI_KEYandPORTconfigured.env.docker-leadwith lead config (AGENT_ID,CLAUDE_CODE_OAUTH_TOKEN,MCP_BASE_URL).env.dockerwith worker config (AGENT_ID,CLAUDE_CODE_OAUTH_TOKENorOPENROUTER_API_KEY,MCP_BASE_URL)
Step 1: Determine Your Port
Check .env for the configured port — do not assume 3013:
grep ^PORT= .envUse this value as $PORT throughout. In worktrees, each worktree may have a different port. Always verify and use the value from .env.
Also verify the Docker env files match:
grep MCP_BASE_URL .env.docker-lead .env.docker
# Both should point to http://host.docker.internal:$PORTIf they don't match, update them before starting containers.
Step 2: Clean DB + Start API Server
# Kill any existing API process on your port
lsof -ti :$PORT | xargs kill 2>/dev/null
# Clean DB for fresh state
rm -f agent-swarm-db.sqlite agent-swarm-db.sqlite-wal agent-swarm-db.sqlite-shm
# Start API server (tagged as a test install so it stays out of production telemetry)
DESPLEGA_TELEMETRY_ENV=test bun run start:http &
# Wait ~3s for startup, confirm "MCP HTTP server running on http://localhost:$PORT/mcp"Keep DESPLEGA_TELEMETRY_ENV=test on every API and container you boot for a test. Without it, the boot reports as a production install and inherits the swarm's SWARM_ORG_NAME.
Step 3: Build Docker Image
bun run docker:build:worker:slimThis builds agent-swarm-worker:slim from the current code — the slim target is faster and sufficient for E2E (all four harnesses included). Use bun run docker:build:worker + agent-swarm-worker:latest instead only when the test needs playwright/agent-browser, local postgres/redis, or glab. Rebuild after every code change.
Step 4: Start Lead Container
Use a unique container name to avoid conflicts with other worktrees (e.g. include branch name or feature):
docker run --rm -d \
--name e2e-lead-$(git branch --show-current | tr '/' '-') \
--env-file .env.docker-lead \
-e DESPLEGA_TELEMETRY_ENV=test \
-e AGENT_ROLE=lead \
-e MAX_CONCURRENT_TASKS=1 \
-p 3201:3000 \
agent-swarm-worker:slimWait ~15s, then verify:
docker logs e2e-lead-$(git branch --show-current | tr '/' '-') 2>&1 | tail -5
# Should see: "[lead] Polling for triggers (0/1 active)..."If port 3201 is taken by another worktree, pick a different host port (e.g. -p 3211:3000).
Step 5: Start Worker Container
docker run --rm -d \
--name e2e-worker-$(git branch --show-current | tr '/' '-') \
--env-file .env.docker \
-e DESPLEGA_TELEMETRY_ENV=test \
-e MAX_CONCURRENT_TASKS=1 \
-p 3203:3000 \
agent-swarm-worker:slimWait ~15s, then verify:
docker logs e2e-worker-$(git branch --show-current | tr '/' '-') 2>&1 | tail -5
# Should see: "[worker] Polling for triggers (0/1 active)..."Step 6: Verify Registration
curl -s -H "Authorization: Bearer $API_KEY" "http://localhost:$PORT/api/agents" \
| jq -r '.agents[] | "\(.name) | isLead: \(.isLead) | status: \(.status) | id: \(.id)"'Should show both lead and worker registered as idle. Save the agent IDs for task creation.
Step 7: Create Tasks
Assigned task (picked up by lead)
const t = await (await fetch('http://localhost:$PORT/api/tasks', {
method: 'POST', headers,
body: JSON.stringify({ task: 'Say hello. Call store-progress with status completed.', agentId: LEAD_ID })
})).json();
console.log('Task:', t.id, '| status:', t.status);Important: Use agentId (not assignedTo) to assign tasks. Wrong param silently creates an unassigned task.
Pool task (auto-claimed by worker)
const t = await (await fetch('http://localhost:$PORT/api/tasks', {
method: 'POST', headers,
body: JSON.stringify({ task: 'Say hello. Call store-progress with status completed.' })
})).json();
console.log('Pool task:', t.id, '| status:', t.status);Workers auto-claim unassigned tasks at poll time. Leads do not auto-claim pool tasks.
Step 8: Monitor Progress
# Watch lead logs (use your container name)
docker logs -f e2e-lead-$(git branch --show-current | tr '/' '-') 2>&1 | tail -20
# Watch worker logs
docker logs -f e2e-worker-$(git branch --show-current | tr '/' '-') 2>&1 | tail -20Poll task status:
const t = await (await fetch('http://localhost:$PORT/api/tasks/<task-id>', { headers })).json();
console.log(t.status); // pending → in_progress → completed/failedStep 9: Verify Session Logs
const logs = await (await fetch('http://localhost:$PORT/api/tasks/<task-id>/session-logs', { headers })).json();
console.log('Log count:', logs.logs.length);
// Should be > 0 for completed tasksFor log isolation verification (multiple sequential tasks from same agent):
const [l1, l2] = await Promise.all([
fetch('http://localhost:$PORT/api/tasks/<task1>/session-logs', { headers }).then(r => r.json()),
fetch('http://localhost:$PORT/api/tasks/<task2>/session-logs', { headers }).then(r => r.json()),
]);
const s1 = [...new Set(l1.logs.map(l => l.sessionId))];
const s2 = [...new Set(l2.logs.map(l => l.sessionId))];
console.log('Unique sessionIds:', s1[0] !== s2[0]); // Should be trueStep 10: Test the Dashboard UI
Start the dashboard to visually verify tasks, logs, and agent status:
cd apps/ui && bun run dev &
# Defaults to port from APP_URL in .env (check with: grep APP_URL ../.env)If the UI port is taken by another worktree, start on an alternate:
cd apps/ui && bun run dev --port 5276The UI connects to the API via VITE_API_URL (check apps/ui/.env or defaults to http://localhost:$PORT).
Visual verification with agent-browser
Use agent-browser to automate UI checks (never qa-use unless explicitly asked):
# Quick visual gut-check with agent-browser
agent-browser open http://localhost:5175
agent-browser snapshot
agent-browser screenshot /tmp/e2e-dashboard.pngThings to verify in the UI:
- Agents page: Lead and worker both show as registered with correct status
- Tasks page: Tasks appear with correct status, assigned agent, and timestamps
- Task detail → Logs tab: Session logs render in the conversation viewer (not "No session data available")
- Task detail → Outcome tab: Completed tasks show output
- Costs: Session costs appear for completed tasks
Step 11: Cleanup
# Stop containers (use your branch-specific names)
docker stop e2e-lead-$(git branch --show-current | tr '/' '-') e2e-worker-$(git branch --show-current | tr '/' '-') 2>/dev/null
# Stop API server
lsof -ti :$PORT | xargs kill 2>/dev/null
# Stop UI dev server (if started)
lsof -ti :5175 | xargs kill 2>/dev/nullTroubleshooting
Docker daemon not running
ERROR: Cannot connect to the Docker daemonFix: open -a OrbStack and wait ~5s.
Container name conflict
docker: Error response from daemon: Conflict. The container name "..." is already in useAnother worktree has a container with the same name. Either stop it (docker stop <name>) or use a different name suffix.
Lead not picking up tasks
- Verify task was created with
agentId(notassignedTo) — wrong param silently creates an unassigned task - Check task status isn't already
in_progress(e.g. from a manual poll call that consumed the trigger) - Restart container if stuck:
docker restart <container-name>
Worker not picking up pool tasks
- Workers auto-claim via poll. Leads do not claim pool tasks.
- Check worker has capacity:
docker logs <container> 2>&1 | grep "capacity" - If "At capacity" — a previous task is still running. Wait or restart.
Poll returns 404
- Poll endpoint is GET
/api/poll(not POST) - Requires
X-Agent-IDheader with a valid agent UUID
Port conflicts (worktrees)
lsof -i :3013 # Check what's using the portIf another worktree is running, set a different PORT in .env and update MCP_BASE_URL in .env.docker* to http://host.docker.internal:<new-port>.
Session logs show 0 entries
- Task must have actually run (status
completedorfailed, not justin_progress) - Check
claudeSessionIdis set on the task:GET /api/tasks/<id>should show it - If logs were stored under wrong taskId, check the
session_logstable directly
Task cancellation doesn't stop Claude
Direct API cancellation (POST /api/tasks/<id>/cancel) updates the DB but doesn't kill the Claude process inside Docker. Use docker restart <container> to force-stop.
Keep tasks trivial
Use simple tasks like "Say hello" for E2E tests. Complex tasks waste time and API credits.
UI shows stale data
The dashboard auto-polls every 5 seconds. If data looks stale, hard-refresh (Cmd+Shift+R) or check VITE_API_URL points to the correct API port.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

