-
Notifications
You must be signed in to change notification settings - Fork 1
Swarm Minion
Jason L. West edited this page Feb 3, 2026
·
1 revision
A Minion is a containerized AI agent that autonomously works on a single GitHub issue. It clones the repository, reads the issue, implements a solution, creates a PR, and reports results back to the Overlord.
Container Start
↓
Load config from environment
↓
Clone repository → Create branch
↓
Fetch issue details from GitHub
↓
Build system prompt with issue context
↓
Run MinionAgent (agentic loop)
├── LLM plans approach
├── Executes tools (read/write/edit files, run commands)
├── May ask clarifying questions (max 3)
└── Loops until complete or blocked
↓
Run tests (if present)
↓
Create PR linked to issue
↓
PR Review (if enabled)
↓
Report completion to Overlord
↓
Container exits
Minion
├── MinionConfig # Environment-based configuration
├── GitHubClient # Issue fetching and PR creation
├── GitManager # Clone, branch, commit, push
├── Reporter # Heartbeat and event reporting to Overlord
├── MinionAgent # Agentic loop (LLM + tools)
│ ├── LLMClient # OpenAI-compatible API client
│ ├── ToolExecutor # Sandboxed tool execution
│ └── PromptBuilder # System prompt construction
└── ReviewWorkflow # Automated PR review (optional)
The MinionAgent runs an agentic loop:
- Send conversation history + tools to LLM
- LLM responds with text and/or tool calls
- Execute tool calls (file reads, writes, edits, shell commands)
- Append results to conversation
- Repeat until the agent calls
task_completeortask_blocked
| Tool | Description |
|---|---|
read_file |
Read file contents from the workspace |
write_file |
Create or overwrite a file |
edit_file |
Make targeted edits within a file |
list_directory |
List directory contents |
search_files |
Search for patterns in files |
glob_files |
Find files by glob pattern |
run_command |
Execute shell commands |
task_complete |
Signal successful completion |
task_blocked |
Signal the task is blocked (with optional question) |
list_skills |
List available skills |
use_skill |
Execute a learned skill |
The agent returns an AgentResult with:
| Status | Meaning |
|---|---|
COMPLETED |
Task finished successfully |
BLOCKED |
Agent needs human input (may include a question) |
TURN_LIMIT |
Maximum turns reached |
ERROR |
Unrecoverable error |
When the agent encounters ambiguity, it can call task_blocked with a question:
- Agent calls
task_blocked(question="Which endpoint should I use?") - Minion sends QUESTION event to Overlord via Reporter
- Overlord posts question to Slack
- Human replies in thread
- Minion polls for answer (up to 10 minutes)
- Answer injected into agent conversation
- Agent resumes work
Limits: 3 questions per run, 10-minute timeout per question. If no answer arrives, the agent continues using its best judgment.
The Reporter maintains communication with the Overlord:
| Method | Event Type | Description |
|---|---|---|
heartbeat() |
HEARTBEAT | Periodic health signal (every 30s) |
update_status() |
STATUS | Phase updates ("cloning", "working", etc.) |
question() |
QUESTION | Ask a clarifying question |
poll_answer() |
- | Poll for answer to a question |
completed() |
COMPLETED | Success with PR details |
error() |
ERROR | Failure with error details |
After completing work, the Minion:
- Stages all changes
- Creates a commit with a descriptive message
- Pushes the branch to the remote
- Creates a PR via the GitHub API
- Links the PR to the original issue
- Optionally runs automated PR review
Branches follow the pattern: minion/{minion-id}/{issue-number}
All configuration is passed via environment variables (set by the Overlord's DockerManager):
| Variable | Default | Description |
|---|---|---|
MINION_ID |
- | Unique minion identifier |
GITHUB_REPO |
- | Repository (owner/name) |
GITHUB_ISSUE |
- | Issue number |
GITHUB_TOKEN |
- | GitHub authentication token |
OVERLORD_CALLBACK_URL |
http://overlord:8080/minion/report |
Report endpoint |
NEBULUS_BASE_URL |
http://localhost:5000/v1 |
LLM server URL |
NEBULUS_MODEL |
qwen3-coder-30b |
Model to use |
NEBULUS_TIMEOUT |
600 |
LLM request timeout |
MINION_TIMEOUT |
1800 |
Total minion timeout (30 min) |
| Resource | Limit |
|---|---|
| Memory | 2 GB |
| CPU | 1 core |
| Network |
nebulus-swarm bridge |
| Workspace | /workspace |
- Nebulus Swarm - System overview
- Swarm Overlord - Control plane
- Model Router - How the model is selected for this minion