Software Development Agent Frameworks: Architecture Patterns and Selection Guide
This article explains how to select a software development agent framework based on task uncertainty, permitted autonomy, auditability, and recovery requirements. It compares autonomous execution loops, multi-role collaboration, and state-graph orchestration; describes the core system layers; and proposes verifiable selection criteria and a phased adoption path.
1. Clarify the Problem First: Do You Need an Agent or a Controllable Workflow?
The goal of a software development agent is to turn natural-language requirements into verifiable engineering outcomes. It may need not only to generate code, but also to understand an existing repository, modify files, install dependencies, run tests, analyze failures, and request human confirmation when necessary.
Framework selection should therefore not depend only on whether the framework supports model calls, or on whether a demo has completed a development task once. The real questions are: How uncertain is the task? How much autonomous decision-making should the system be allowed? Must the execution process be auditable? And how should the system recover after failure?
For example, a code inspection report with a fixed format can use an explicit workflow: read the input, run the checks, and organize the results. Fixing a defect across multiple modules often requires exploration: locate the relevant code, form a hypothesis, validate it through tests, and then adjust the implementation. These two types of tasks impose different requirements on a framework.
Requirements can be divided into three levels:
- Assisted generation: The system proposes code, explanations, and modification suggestions, and the developer decides whether to adopt them.
- Controlled execution: The system completes tasks within a limited directory and tool scope, with key operations subject to approval.
- Autonomous progression: The system adjusts its plan based on feedback and continues until acceptance criteria are met or a stop rule is triggered.
The higher the degree of autonomy, the greater the requirements for state management, execution isolation, budget control, and observability. High autonomy does not automatically mean greater suitability for enterprise production environments.
2. Three Typical Architectures and Their Applicable Boundaries
1. Autonomous Execution: Centered on an Observe-Decide-Act Loop
This architecture usually has a primary agent that maintains task state. It reads user requirements and execution feedback, decides the next action, calls tools, and continues reasoning based on the results.
Its core loop can be summarized as:
Task input → environment observation → action selection → tool execution → result feedback → state update
It is suitable for tasks whose steps are difficult to determine in advance, such as exploring an unfamiliar repository, locating the cause of a test failure, or modifying a local feature. Its advantage is flexibility: the system can change its path according to actual conditions rather than strictly following a predefined process.
Its limitations are also clear. Long tasks are prone to repeated searching, goal drift, and ineffective retries. Without stop conditions, execution costs may continue to grow. When evaluating this type of approach, focus on task tracking, context compression, action permissions, loop detection, and budget limits, rather than only on the quality of a single code generation.
2. Multi-Role Collaboration: Centered on Task Division and Artifact Handoff
This architecture splits development activities into different responsibilities, such as requirements analysis, solution design, implementation, testing, and review. Roles collaborate through task descriptions, structured artifacts, or shared state.
Its value does not lie in the idea that “more roles mean more intelligence,” but in clear responsibility boundaries. For example, the implementation role submits change descriptions and test results, while the review role checks logical gaps against acceptance criteria. The judgment bases of the two roles can complement each other.
However, multiple roles may still share similar model capabilities and cognitive biases. Role division should not be equated with truly independent verification. Reliable verification should still come from tests, static checks, constraint rules, and human review.
This architecture is suitable for complex tasks with clear artifacts and clear phase boundaries. Selection should examine:
- Whether roles pass natural-language descriptions or verifiable structured artifacts.
- Whether there is a clear adjudication and fallback mechanism when disagreements occur.
- Whether concurrent conflicts can be avoided when modifying files.
- Whether collaboration overhead exceeds the benefits of division of labor.
For small-scale changes, too many roles may increase latency and information loss and may not be more effective than a single agent.
3. State-Graph Orchestration: Centered on Explicit States and Transition Conditions
This architecture represents tasks as nodes, states, and transition rules. Nodes can perform model reasoning, tool operations, condition checks, or human approval; the system decides which node to enter based on the current state.
It is suitable for scenarios with relatively stable processes that require explicit approval and exception handling. For example:
Requirements validation → repository analysis → change plan confirmation → execute changes → test validation → human acceptance
If a test fails, the flow can move to a diagnosis node. If the modification scope needs to be expanded, the flow can pause and request approval. This design makes it easier to express business boundaries and to set checkpoints and recovery mechanisms.
Note that a state graph is only an organizational approach; it does not automatically guarantee business reliability. Whether nodes are idempotent, whether state is persisted, and whether tools have side effects all need to be designed separately.
Real systems do not have to adhere to a single architecture. A common combination is: use an explicit outer flow to control permissions and approvals, allow the agent to explore autonomously inside, and introduce review roles at specific stages.
3. Understanding Core Modules Through System Layers
A complete software development agent system can be abstracted into the following structure:
User requirements and acceptance criteria
↓
Task orchestration and permission policy
↓
Context organization and knowledge selection
↓
Model reasoning and action generation
↓
Tool parameter validation and execution scheduling
↓
Isolated execution environment
↓
Observation results and event records
↓
State update, validation, or human approval
This is not a fixed call order that every implementation must follow. For example, context compression may be triggered before each model call, or by history length or event count. The purpose of layering is to clarify the responsibilities of each module and the boundaries of failures.
1. Context Organization: Show the Model Relevant Information, Not All Information
Model input usually needs to include the task goal, repository constraints, current plan, relevant code, and recent execution results.
Repository constraints can describe directory structure, coding standards, testing requirements, and content that must not be modified. Task knowledge can supplement checklists for certain types of operations. Knowledge selection can use explicit configuration, rule matching, or retrieval mechanisms, but simple keyword hits should not be treated as accurate understanding.
For example, the appearance of “database” in a requirement does not mean that all data management knowledge should be injected. A more reasonable approach is to first determine the task scope, then select content relevant to the current action.
In addition, code, logs, and external documents may contain instruction-like text. The system should treat this content as data to be analyzed, rather than allowing it to override task constraints and permission policies.
2. Context Compression: Preserve a Task State That Can Continue Execution
Long tasks generate large amounts of tool output. Directly accumulating all history can crowd the model input space and dilute important constraints.
Effective compression should prioritize preserving:
- The current goal and acceptance criteria.
- Modified files and the reasons for modification.
- Verified facts and unverified assumptions.
- Failed attempts and the evidence of their failure.
- Current blockers, TODOs, and permission boundaries.
- References to original logs, patches, and test reports.
A compressed summary is not a substitute for original evidence. Key artifacts should be stored separately and read on demand by later steps. Clearly distinguishing “guessed,” “executed,” and “verified” can reduce the propagation of incorrect conclusions during long tasks.
3. Model Access: A Unified Entry Point Does Not Mean Unified Behavior
A unified model access layer can reduce duplication in calling code, but models may differ in tool-calling capability, output stability, input capacity, and response characteristics.
Capability configurations should therefore be established rather than assuming that all models can be replaced interchangeably. Tool-call results especially need checks for correct structure, complete parameters, and whether the action complies with current permissions.
Selection tests should cover real development tasks, not just natural-language answers. For example, they can test whether a model can accurately locate files, handle test failures, respect modification scope, and proactively stop when evidence is insufficient.
4. Tool Layer: Convert Intent into Constrained Operations
Common tool capabilities include file reading and modification, directory search, command execution, page interaction, and task state updates.
The tool layer should handle parameter validation, path checks, permission verification, timeout control, and output limits. A model proposing an action does not mean that the action can be executed directly.
File modification should preferably support diff display and inspection of original content to avoid overwriting concurrent updates. Command execution should distinguish read-only checks, normal builds, and high-risk operations. Deleting large numbers of files, accessing credentials, changing permissions, or performing external writes should all have stricter controls.
5. Execution Environment: Isolate Risk and Ensure Reproducibility
The isolated execution environment limits the files, network, and resources that the agent can access. The working directory, dependency environment, process lifecycle, and external access policies should all be explicit.
Containerization can help with isolation, but it should not be regarded as an absolute security boundary. High-risk or multi-tenant scenarios also require stricter runtime isolation, least privilege, resource quotas, and credential management.
Reproducibility is equally important. Test results should be associated with code version, dependency information, and execution environment; otherwise, the same modification may produce inconsistent results in different environments.
6. Events and State: Record the Process, but Do Not Confuse “Request” with “Completion”
Event records can store user input, action requests, execution results, approval decisions, and state changes for auditing and failure analysis.
The system should distinguish between an action being proposed, approved, executing, succeeding, and failing. Recording an action request does not prove that the operation has been completed.
Event replay is also not equivalent to safe replay. Reading files is usually easy to repeat, but sending notifications, committing changes, or writing to external systems may produce duplicate side effects. Recovery mechanisms need to combine idempotency design, execution result verification, and human confirmation.
4. How to Establish Verifiable Selection Criteria
Selection should proceed in two steps: first determine non-negotiable gates, then compare the solutions that pass those gates.
Gates can include execution isolation, permission auditing, sensitive information handling, human approval, and failure recovery. Security requirements cannot be offset by a higher task success rate.
After passing the gates, evaluate solutions across the following dimensions:
| Dimension | Core Question | Verification Method |
|---|---|---|
| Task organization | Can it express exploration, division of labor, and approval? | Run representative tasks |
| Engineering quality | Do modifications meet acceptance criteria? | Automated tests and human review |
| State recovery | Can it continue correctly after interruption? | Inject process or network faults |
| Execution control | Does it block unauthorized actions? | Path, network, and permission tests |
| Observability | Can failed steps be located? | Inspect events, logs, and artifacts |
| Integration cost | Can it integrate with existing processes? | Implement a small-scale integration |
| Operating cost | Are there ineffective loops? | Count calls, retries, and human interventions |
Task success should be based on final engineering artifacts, not on whether the agent claims completion. Evaluations should also report elapsed time, resource consumption, and human involvement, avoiding the mistake of treating results after extensive human repair as autonomous success.
Test sets need to cover different levels of difficulty and risk: local modifications, cross-file changes, failure diagnosis, dependency issues, and operations that must be refused or require approval. Critical tasks should be tested repeatedly to observe stability rather than relying on a single successful demonstration.
5. Roll Out in Phases and Gradually Expand Autonomy
Phase 1: Read-Only Analysis and Suggestion Output
First let the system perform repository understanding, issue localization, and modification suggestions without granting write access. Focus on verifying whether context acquisition is accurate, whether conclusions are supported by evidence, and whether the task scope is respected.
Phase 2: Limited Modification and Automatic Validation
Allow the system to modify specified files in an isolated copy, run existing tests, and output diffs, validation results, and known risks. Developers remain responsible for final confirmation.
At this stage, establish task-level budgets and stop rules. When there are consecutive failures, repeated execution of the same action, expansion of modification scope, or missing required credentials, the system should pause rather than retry indefinitely.
Phase 3: Introduce Recovery and Collaboration Mechanisms
After the basic loop is stable, add checkpoints, human approval, independent review roles, and concurrent execution. Concurrent tasks should have clear file ownership and merge strategies to avoid overwriting each other in a shared workspace.
Each expansion of capability scope should revalidate security boundaries and recovery behavior. Autonomy should be expanded gradually based on measured results, not by opening all tool permissions at once.
6. Conclusion: Choose an Architecture That Can Be Verified and Constrained
The core differences among software development agent frameworks are not limited to the number of integrated models or the variety of tools. They also lie in how tasks are organized, how evidence is maintained, how execution is controlled, and how failures are handled.
Highly exploratory tasks need a flexible action loop. Tasks with clear phases can benefit from role division. Tasks with strict approval requirements and stable processes are better suited to explicit state orchestration. Complex scenarios often require a combination of several mechanisms.
A truly reliable system should be able to state which step it has reached, what the evidence is, which validations are still missing, and when it must hand control back to a human. Using these capabilities as selection criteria is how software development agents can move from demos that “look like they can develop software” toward auditable, recoverable, and sustainable engineering practice.
