24/7 Multi-Agent Software Development with Open-Source Code Models
This article examines how to build a continuously running software development pipeline using open-source code models and specialized AI agents. It covers artifact-driven coordination, task state machines, context isolation, coding-agent workflows, testing, and delivery, with practical guidance on observability, cost control, security, and human review.
1. Why Software Delivery Needs Multiple Agents
A single large language model (LLM) agent can perform well in short conversations. Real software delivery, however, introduces three constraints.
First, requirements analysis, product design, architectural decisions, implementation, and acceptance testing require very different knowledge domains. Keeping all of them in one context is difficult.
Second, end-to-end tasks can span dozens or even hundreds of conversational turns. Even a large context window can become diluted, causing the model to lose track of earlier constraints.
Third, development work naturally involves parallel execution. Running everything sequentially makes delivery timelines harder to control.
A multi-agent system divides delivery into specialized roles. Each agent maintains its own context and collaborates through structured artifacts and messages. This limits context contamination, enables parallel work, allows failures to be retried locally, and gives people clear points at which to intervene.
The approach described here follows a complete workflow: requirements intake, market research, product requirements, architecture, development, testing, and delivery. The goal is an automated development pipeline that can operate continuously.
2. Architecture: Organizing Agents Around Deliverables
The system uses a hybrid topology consisting of a coordinator agent, specialized agents, and a task board.
The coordinator receives external requests, decomposes work, tracks progress, and consolidates deliverables. Specialized roles include market researcher, product manager, architect, development lead, developer, test engineer, and delivery coordinator.
Each agent is responsible for its own deliverables rather than sharing the entire conversation history.
The task board is the system’s central state store. Each task includes a task ID, parent task ID, role, input references, output reference, status, deadline, and retry count.
The normal state transition is:
pending → assigned → running → review → done
When a task encounters an exception that requires intervention, it enters blocked.
Task dependencies form a directed acyclic graph (DAG). The coordinator advances this graph without directly interfering with the specialized agents’ internal reasoning.
task:id: T-20240501-003parent: T-20240501-001role: architectinput_refs:- doc://prd/v3- doc://market-research/v2output_ref: doc://architecture/v1status: runningdeadline: 2024-05-01T18:00:00Zretry: 1
This design separates task state from agent sessions. If an agent crashes or times out, its task can be requeued and resumed in a new session without losing overall progress.
3. Model Requirements and Selection
Multi-agent collaboration demands more from a model than single-turn question answering. Three capabilities matter most:
- Stability across long-running tasks.
- Retention of important information in long contexts.
- Continuity across multi-turn task workflows.
A market research agent may need to read dozens of competitor documents in one session and produce structured findings. A development lead must retain architectural constraints, interface agreements, and testing standards across multiple interactions. A testing agent must generate cases from the product requirements document (PRD) and code changes while interpreting failure logs.
Open-source code models offer several advantages for these workflows: private deployment, controllable costs, lightweight fine-tuning for team coding conventions, and visibility into the inference workflow for observability.
Model evaluation should focus on four areas:
- Multi-turn tool use.
- Long-document comprehension.
- Code patch generation.
- Diagnosing failures from error logs.
Single-shot code completion scores are not enough. In practice, preserving context and maintaining task continuity after dozens of turns can matter more than the quality of an isolated response.
At the infrastructure layer, general-purpose services such as container platforms, message queues, object storage, logging, and monitoring can support agent runtimes, communication, artifact persistence, and observability. Baidu AI Cloud provides these categories of services, which are not tied to a particular agent framework. Their suitability for a deployment should be assessed against the relevant service availability and requirements.
4. Task Orchestration and State Management
Requests typically arrive as natural-language messages from an enterprise collaboration platform. The coordinator first identifies the intent and confirms the scope, then divides the request into six stages:
Research → Product → Architecture → Development → Testing → Delivery
Each stage is further decomposed into independently executable tasks. The resulting task definitions are written to the task board as JSON.
{"task_id": "T-001","role": "product_manager","depends_on": ["T-000"],"deliverable": "prd_document","acceptance": ["Includes user stories","Includes acceptance criteria","Includes non-functional requirements"]}
A scheduler manages state transitions. It scans pending tasks, checks their dependencies, and assigns eligible work to available agents.
When an agent finishes, it stores its deliverable in object storage and moves the task to review. The coordinator checks consistency. If the deliverable passes, the task becomes done; otherwise, it is returned with revision instructions.
Every task has a timeout and a maximum retry count. Timed-out tasks are routed to a dead-letter queue, where a person decides whether to retry, reduce the scope, or terminate the task.
Three engineering mechanisms are particularly important:
- Task idempotency: Repeated execution of the same task must not create unintended side effects.
- Artifact versioning: Each output carries a version so that changes can be traced.
- Human approval gates: PRDs and architectural designs require human confirmation by default.
Together, these mechanisms prevent a single failure from destabilizing the entire automated pipeline.
5. Context Isolation and Handoff Contracts
Each agent has an independent session and does not directly read other agents’ full conversation histories. Agents exchange only three types of information:
- Structured artifacts: Formal outputs such as PRDs, architecture descriptions, code changes, and test reports.
- Summaries: Short descriptions that allow downstream agents to understand an artifact quickly.
- References: Links to complete, versioned artifacts in object storage, retrieved when needed.
The original workflow uses summaries of approximately 200–500 Chinese characters; in an English implementation, the intent is likewise a compact handoff rather than a full document copy.
This contract-based handoff prevents exploratory discussion from contaminating downstream context. A developer does not need the market research agent’s full deliberations—only the approved PRD, architectural constraints, and interface definitions.
For long-running tasks, agents use rolling summaries. After each substep, the agent records key decisions, unresolved questions, and output summaries in session memory. Long source documents remain available through references rather than being repeatedly inserted into the conversation.
A handoff document should use a fixed set of fields:
- Task objective.
- Input assumptions.
- Output inventory.
- Key decisions.
- Risks and items requiring confirmation.
- Downstream dependencies.
A stable schema lets the coordinator apply rule-based completeness checks and reduces information loss between agents.
6. Coordinating the Development Lead and Local Coding Agents
Development is usually the longest stage in the pipeline.
A development lead agent breaks the architecture into implementation tasks, assigns priorities, reviews code changes, and decides whether changes should be merged.
Local coding agents perform the implementation in a controlled environment. They can read the repository, edit files, run test commands, inspect error logs, and submit changes as patches.
The development loop can be represented as follows:
while has_pending_tasks():task = task_board.claim(role="developer")context = load_context(task.input_refs)patch = code_agent.generate_patch(context)test_result = sandbox.run_tests(patch)if test_result.passed and quality_gate(patch):task_board.submit_for_review(task, patch)else:task_board.record_failure(task, test_result.log)task_board.requeue(task, reason="test_failed")
At a minimum, the quality gate checks that:
- Static checks pass.
- Unit tests pass.
- Coverage meets the required threshold.
- No high-severity security alerts are present.
- The change scope matches the task description.
Based on these results, the development lead chooses whether to submit the patch for review, request revisions, or escalate to a person.
Because local coding agents run in sandboxes, continuous execution does not affect the production environment. Failed patches can be rolled back automatically.
7. Testing, Delivery, and an Example Workflow
The testing agent generates test cases from the PRD’s acceptance criteria, prioritizing normal behavior, boundary conditions, and error paths.
Execution results are written to a test report. Failed cases are automatically linked to the relevant development tasks, creating a testing-and-fixing feedback loop.
The delivery coordinator prepares delivery notes, a deployment checklist, and an acceptance report. It then returns the key artifact references to the original request channel.
Example: A Competitor Price Monitoring System
A competitor price monitoring system illustrates how these roles work together:
- Market research: The research agent produces a competitor list and recommends monitoring dimensions.
- Product requirements: The product manager defines scheduled collection of current prices, original prices, discounts, and stock status. The PRD also specifies trend charts, unusual price-change markers, alerts for low prices, sharp fluctuations, and out-of-stock conditions, plus export to common spreadsheet formats.
- Architecture: The architect defines modules for collection scheduling, data storage, a rules engine, alert channels, and visualization.
- Development: The development lead turns these modules into implementation tasks, which local coding agents complete individually.
- Testing: The testing agent verifies collection frequency, alert thresholds, and export completeness.
- Delivery: The delivery coordinator consolidates the outputs and acceptance results.
In the workflow described, context was retained across dozens of conversational turns, and task dependencies remained intact throughout the delivery chain.
8. Engineering Best Practices
Start with Observability
Log each agent’s input and output summaries, execution time, token usage, tool-call count, and failure reasons. Correlate these records by task ID.
Without observability, a multi-agent system becomes a black box.
Control Costs
Use smaller models for straightforward classification and formatting tasks, and larger models for complex reasoning and code generation.
Apply rolling summaries and document references instead of supplying the full document set on every turn. Cache repeated queries where appropriate.
Enforce Security and Permissions
Run local coding agents in least-privilege sandboxes. Require code changes to pass review gates.
For messages arriving from external collaboration platforms, apply signature verification and rate limiting.
Design for Reliability
Use backoff when retrying tasks. Provide human handling for dead-letter queues, and require approval for critical deliverables.
Automation does not mean eliminating people. It means concentrating human attention on exceptions and consequential decisions.
Evaluate Continuously
Maintain an offline evaluation set covering:
- Requirements decomposition.
- PRD completeness.
- Whether generated code patches run successfully.
- Test-case effectiveness.
Run regression evaluations whenever prompts or model versions change. A workflow that appears better in a few examples may still have regressed overall.
9. Conclusion
The foundation of multi-agent software development is not the number of agents. It is a network of tasks with explicit contracts, persistent state, and observable execution.
Open-source code models provide a privately deployable, iteratively adaptable inference engine for continuous development workflows. System stability, however, depends on engineering controls: task state machines, context isolation, handoff protocols, and quality gates.
Start with one focused use case and establish a complete requirements-to-delivery workflow before expanding the number of roles or increasing parallelism.
General-purpose infrastructure—including container platforms, message queues, object storage, logging, monitoring, and alerting—can reduce the effort required to build agent runtimes and observability. Services in these categories, including those offered by Baidu AI Cloud where suitable and available, can serve as the underlying infrastructure without tying the workflow to a specific agent framework.
