Choosing an Agent Working Mode
Choosing an Agent Working Mode
Before launching an Agent, you need to choose a working mode. The working mode determines how the task is split, how sub-agents collaborate, when you need to confirm things, and how deliverables are accepted.
Heicode's working modes fall into two categories:
- Collaboration modes: determine how multiple Agents work together, including Sub mode and Swarm mode.
- Delivery modes: determine how the task moves forward and gets accepted, including Waterfall mode and Agile mode.
Sub mode is not Swarm mode. Sub mode is the basic capability where a main Agent splits up the task and sub-agents collaborate explicitly; Swarm mode is a different collaboration style in Heicode — on a tenant-level virtual machine, a lead Agent and multiple worker Agents run together, where the lead receives the goal, breaks the task down, and dispatches it, and workers claim and execute subtasks, with up to 8 workers, 3 by default (adjustable by plan). This is a lead-dispatches, worker-executes architecture — not a decentralized, self-organizing system with no central scheduling where Agents compete for tasks on their own.
Waterfall mode and Agile mode correspond to the two fixed templates in the one-click "Dev Mode Team" deployment feature, with fixed roles and headcounts: Agile = Product (planner) + Dev (executor) + Review (code-reviewer), 3 roles total; Waterfall = Analysis (analyst) + Architecture (architect) + Dev (executor) + QA (qa-tester) + Review (code-reviewer), 5 roles total.
Quick comparison of the four modes
| Dimension | Sub mode | Swarm mode | Waterfall mode (fixed 5-role template) | Agile mode (fixed 3-role template) |
|---|---|---|---|---|
| Type | Collaboration mode | Collaboration mode | Delivery mode | Delivery mode |
| Core idea | The main Agent splits the task; sub-agents execute by responsibility | The lead breaks down the task; multiple workers execute in parallel | Progress through fixed stages in sequence | Continuous iteration in short cycles |
| Coordination | Explicit assignment, handoff, and aggregation by the main Agent | The lead dispatches tasks; workers claim, execute, and report; the lead aggregates results | Move to the next stage only after the previous one is confirmed | Plan, execute, accept, and adjust each round |
| User involvement | Steps in on key questions, approvals, and acceptance | Sets budget boundaries, handles anomalies, accepts aggregated results | Confirms at the end of each stage | Provides feedback at the end of each iteration |
| Good fit | Clear division of labor, multi-module development, complex troubleshooting | Multi-source research, complex exploration, large-scale parallel review | Production releases, compliance documentation, migrations, formal delivery | Product features, MVPs, UI/UX optimization |
| Main risk | Inaccurate task splitting by the main Agent, duplicate subtasks | Runaway worker count or budget, uncontrolled cost | Early requirement errors affect later stages | Frequent changes may expand scope |
| Budget control | Controlled per sub-agent | Controlled by total budget and per-worker cap | Controlled per stage | Controlled per iteration |
| Acceptance method | The main Agent aggregates, then accepts | The lead aggregates worker results, then accepts; human arbitration when necessary | Stage acceptance and final acceptance | Incremental acceptance each round |
Sub mode
Sub mode is Heicode's basic multi-Agent collaboration style. Its focus isn't "swarm self-organization" but "controlled decomposition by a main Agent."
In Sub mode, the main Agent is responsible for understanding the user's goal, splitting it into subtasks, assigning them to sub-agents, aggregating the results, and delivering to the user. Sub-agents are responsible for a single area, such as research, frontend, backend, testing, review, or deployment.
How Sub mode works
User goal
-> Main Agent understands the goal
-> Main Agent splits into subtasks
-> Sub-agents are created or invoked
-> Sub-agents execute their own tasks
-> Sub-agents explicitly hand off results
-> Main Agent aggregates
-> Verify and deliverKey Sub mode concepts
| Concept | Meaning |
|---|---|
| Main Agent | The central coordinator, responsible for splitting, assigning, aggregating, and reporting |
| Sub-agent | A single-responsibility executor, handling only the local task assigned to it |
| Explicit task | A sub-agent's task is explicitly given by the main Agent or the user |
| Handoff | A sub-agent hands its result or a problem off to the main Agent or the next sub-agent once done |
| Aggregation | The main Agent consolidates each subtask into a unified deliverable |
| Controlled boundary | Each sub-agent has clearly defined resources, permissions, budget, and approval rules |
The relationship between Sub mode and Swarm mode
Sub mode and Heicode's Swarm mode both fall under "multi-Agent collaboration," but they differ in how control works:
- Sub mode has no lead/worker role split — subtasks are explicitly assigned by the main Agent.
- Swarm mode has a clear lead and workers: the lead breaks the task down and dispatches it, and workers claim, execute, and report their heartbeat.
- Sub mode centers on handoff and aggregation; Swarm mode also needs the lead to aggregate results across multiple workers.
- Sub mode fits controlled division of labor with clear boundaries; Swarm mode fits exploratory tasks that need multiple workers processing in parallel.
Simply put: Sub mode and Swarm mode are two different multi-Agent collaboration styles in Heicode. Swarm mode is not simply an upgrade of Sub mode — it's a lead-plus-worker architecture.
When to choose Sub mode
Choose Sub mode when:
- A task needs multiple specialized roles involved.
- Subtask boundaries are relatively clear.
- You need the main Agent to keep unified control of direction.
- You need implementation, testing, and review handled separately.
- The problem is complex, but doesn't yet need large-scale parallel processing across many workers.
- You need to keep the task within a clear budget and permission scope.
Sub mode is not recommended when:
- The task is small enough for a single Agent.
- Requirements are unclear — the goal itself isn't defined.
- Subtasks are strongly dependent on shared, dynamically changing state.
- You need a large number of Agents to automatically find tasks and influence each other.
- Output must be signed off strictly by fixed stages.
Sub mode configuration recommendations
The number of sub-agents should be adjusted based on actual task needs — there's no fixed tier; it depends on task boundaries and division of responsibility.
Common role combinations (roles drawn from Heicode's 19 role templates, such as analyst, architect, code-reviewer, debugger, executor, planner, qa-tester, etc.):
| Scenario | Recommended combination |
|---|---|
| New feature | planner, executor, code-reviewer |
| Complex bug | debugger, code-reviewer |
| Documentation and resource center | document-specialist, code-reviewer |
| Cloud deployment | explorer, code-reviewer |
| Large refactor | architect, executor, code-reviewer |
Permission recommendations:
- Each sub-agent only gets the resources it needs.
- code-reviewer Agents don't directly modify production resources by default.
- explorer Agents can prepare deployments, but production deployment must be approved.
- What sub-agents share is task state and results, not unnecessary secrets.
Swarm mode
Swarm mode is one of Heicode's multi-Agent collaboration styles, using a lead-plus-worker architecture: each tenant maps to an Azure virtual machine, on which an api container, a lead container, and several worker containers run via docker-compose. The lead receives the user's goal, breaks the task down, and dispatches it to workers; workers claim tasks, execute them, and report results back to the lead. Up to 8 workers, 3 by default (adjustable by plan).
Swarm mode is a good fit for complex tasks that need multiple workers processing in parallel. It is not a decentralized system with no central scheduling — it's a lead-plus-worker architecture with a clear lead responsible for decomposition and scheduling.
How Swarm mode works
User goal
-> The lead Agent receives the goal
-> The lead breaks it into subtasks
-> Workers claim the subtasks dispatched to them
-> Workers execute, and report heartbeat and progress
-> High-risk operations go through approval
-> The lead aggregates worker results
-> Verify and deliverCore components of Swarm mode
| Component | Role |
|---|---|
| lead Agent | Receives the goal, breaks down the task, dispatches to workers, aggregates results |
| worker Agent | Claims subtasks dispatched by the lead and executes them, reports heartbeat |
| api container | Handles the request entry point, interfaces with Manager and the client |
| Permissions and resource references | Manages Git, documentation, SK, cloud resources, and secret references |
| Approval | Manages high-risk confirmations for production deployment, cloud operations, secret access, etc. |
| Audit | Records the subject, resource, time, result, and usage of every action |
Differences between Swarm mode and Sub mode
| Dimension | Sub mode | Swarm mode |
|---|---|---|
| Control style | The main Agent explicitly assigns tasks | The lead Agent breaks down and dispatches tasks to workers |
| Task source | Split and handed down by the main Agent | Broken down by the lead and handed down to workers |
| Collaboration style | Mainly explicit handoff | The lead dispatches, workers execute and report |
| Failure handling | The main Agent reassigns or stops | The lead can redispatch to another worker |
| How results form | Aggregated by the main Agent | Aggregated by the lead across workers |
| Applicable scale | Small to medium multi-role tasks | Tasks needing parallel processing across workers, up to 8 |
| Risk control | Easy to control | Depends on budget, worker count cap, and approval boundaries |
When to choose Swarm mode
Choose Swarm mode when:
- The task needs multiple Agents exploring simultaneously from different directions.
- Subtasks have dynamic dependencies that can't be fully split up front.
- You need to continuously absorb new information and adjust the path.
- You need multiple results to cross-check, complement, or compete with each other.
- You need to handle large-scale code review, research, or complex troubleshooting.
- A single main Agent would easily become a bottleneck.
Swarm mode is not recommended when:
- The task goal is very small.
- Acceptance criteria are unclear.
- The budget is very tight.
- No one is available to handle exception approvals.
- Production high-risk operations are involved without a clear boundary.
- You need strongly consistent transactions or a strictly linear process.
Swarm mode configuration recommendations
Confirm before launching:
- How the lead plans to break down the task.
- What resources each worker can access.
- The worker count cap (up to 8, 3 by default, adjustable by plan).
- Which actions must require human approval.
Recommended constraints:
- Confirm the worker count cap per plan, not exceeding 8.
- Production operations must exit the swarm's automatic flow and go through approval.
Swarm mode monitoring focus
Focus on:
- Whether tasks broken down by the lead are piling up.
- Whether any worker is duplicating work on the same task.
- Whether a worker is stuck or hasn't reported a heartbeat in a long time.
- Which worker is consuming the most budget.
- Whether there are high-risk permission requests.
- Whether the lead's aggregated results have clear evidence.
When you find a problem, you can:
- Stop an abnormal worker.
- Reduce worker concurrency.
- Ask the lead to summarize current results early.
- Switch to Sub mode for controlled decomposition.
- Switch to Waterfall mode for formal delivery.
Waterfall mode
Waterfall mode is a good fit for tasks with clear goals, a clear stage order, and risk that needs strict control. It requires that one stage be completed and confirmed before moving to the next.
How Waterfall mode works
Requirements confirmation
-> Design
-> Implementation
-> Testing
-> Review
-> Release preparation
-> Release approval
-> Delivery archivingEach stage should have a clear output.
| Stage | Typical output |
|---|---|
| Requirements confirmation | Requirements summary, scope boundary, acceptance criteria |
| Design | Technical approach, risk points, resource plan |
| Implementation | Code diff, documentation changes, config changes |
| Testing | Test results, failed items, fix records |
| Review | Review conclusion, risk notes, whether it can be released |
| Release preparation | Build record, deployment plan, rollback plan |
| Release approval | Approval record, credential TTL, scope of impact |
| Delivery archiving | Delivery notes, audit summary, follow-up items |
When to choose Waterfall mode
Choose Waterfall mode when:
- Requirements are already clear.
- The delivery boundary is fixed.
- Production release is involved.
- Customer delivery, compliance, legal, or security content is involved.
- A complete audit trail is required.
- The team wants sign-off confirmation at every stage.
Waterfall mode is not recommended when:
- The goal is still being explored.
- The product direction needs frequent adjustment.
- You need to quickly try multiple approaches.
- You don't know what the final deliverable should be.
Agile mode
Agile mode is a good fit for tasks that need continuous iteration. It doesn't aim to finish everything in one shot — instead, each round delivers a verifiable increment.
How Agile mode works
Establish the goal
-> Choose this round's scope
-> Execute
-> Verify
-> Demo or deliver
-> Collect feedback
-> Adjust for the next roundEvery round should answer three questions:
- What are we doing this round.
- What are we not doing this round.
- What counts as done this round.
When to choose Agile mode
Choose Agile mode when:
- Product requirements are still changing.
- You want to complete an MVP first.
- UI, interaction, or copy needs multiple rounds of adjustment.
- You need feedback from the customer or team every round.
- The task can be broken into multiple small increments.
- You don't want to open up too much permission at once.
Agile mode is not recommended when:
- It's a one-off migration or release that can't be split into rounds.
- Requirements are already strictly frozen.
- No one is responsible for each round's feedback.
- The team has no time to accept increments.
How to choose a mode
You can choose based on these rules:
| Task characteristics | Recommended mode |
|---|---|
| Clear division of roles, needs main Agent control | Sub mode |
| Multi-directional exploration, tasks generated and interacting dynamically | Swarm mode |
| Clear requirements, high risk, needs stage sign-off | Waterfall mode |
| Requirements will change, needs continuous feedback | Agile mode |
| Explore an approach first, then move to stable delivery | Swarm mode or Sub mode, then switch to Waterfall mode |
| Build an MVP first, then keep optimizing | Agile mode |
| Involves production deployment and rollback | Waterfall mode |
| Needs multiple Agents reviewing security, performance, and testing to complement each other | Swarm mode |
Can modes be combined?
Yes. Collaboration modes and delivery modes are usually used together.
Common combinations:
- Agile + Sub: within each iteration, multiple sub-agents divide the work to hit this round's goal.
- Agile + Swarm: within each iteration, multiple Swarm workers quickly explore approaches, risks, and implementation paths.
- Waterfall + Sub: within each stage, sub-agents divide the work, with strict acceptance between stages.
- Swarm to Waterfall: once exploration is done and the approach has stabilized, move into the formal release stage.
- Sub to Swarm: when static decomposition proves insufficient, and more parallel workers are needed.
Before switching, confirm:
- Whether current deliverables have been saved.
- Whether unfinished tasks have been archived.
- Whether the budget has been reset.
- Whether permissions need to be narrowed or widened.
- Whether approval rules still apply.
- Whether the reason for switching is recorded in the audit trail.
Mode selection examples
Example 1: Fixing a login failure
Recommended: Sub mode.
Reasons:
- The Backend Agent analyzes the error and checks the endpoint.
- The Frontend Agent checks the client-side redirect logic.
- The Reviewer Agent verifies the fix.
- Subtask boundaries are clear — Swarm mode's multi-worker parallelism isn't needed.
Example 2: Large-scale code review
Recommended: Swarm mode.
Reasons:
- Security, performance, testing, dependencies, and architecture can be reviewed in parallel by multiple workers.
- Discovered issues can generate follow-up tasks.
- Results from multiple workers can cross-check each other.
- The lead aggregates everything into a unified risk list.
Example 3: Launching a legal terms page
Recommended: Waterfall mode.
Reasons:
- Content needs to be accurate.
- Review is needed before release.
- Production deployment requires approval.
- Delivery requires archiving and audit.
Example 4: Designing a resource center
Recommended: Agile mode.
Reasons:
- Content and structure need multiple rounds of confirmation.
- You can build a documentation version first, then an in-site page.
- Every round can produce inspectable output.
On the term "Swarm"
The word "swarm" easily makes people think of a decentralized system with no central scheduling, where Agents compete for tasks on their own — but the Swarm mode Heicode has actually implemented isn't like that: it's a lead-plus-worker architecture, where one lead on a tenant virtual machine is responsible for breaking down and dispatching tasks, and up to 8 (3 by default) workers are responsible for claiming and executing them.
Heicode layers platform constraints on top of this architecture:
- Permission boundaries.
- Approval rules.
- Budget caps.
- Credential TTL.
- Audit records.
- The ability to stop and take over.
This means customers get controllable lead/worker collaboration, not untrackable automated sprawl.
Last updated on