AI Coding Assistant Architecture: Model-Native Agents vs. External Control Frameworks

    AI coding assistants are moving beyond code completion toward agents that can refactor across files, automate testing, and build complete business modules. This article compares two architectural paths: model-native agents, where the LLM directly owns planning, tool use, and error recovery, and LLM-plus-control-framework designs, where an external system manages prompts, context, permissions, and retries. It examines both through two lenses—underlying architecture and multi-agent collaboration—and contrasts fixed Plan/Build roles with dynamically generated subagents and workflows. It also offers selection guidance for security-sensitive enterprises, fast-moving innovation projects, and cloud-native deployments, and concludes that the two approaches are converging toward a balance between autonomy and controllability.

    Large language models continue to advance, and AI-assisted programming tools are evolving from simple code-snippet completion into agents capable of cross-file refactoring, automated testing, and even complete business-module development. As this evolution unfolds, the industry has split into two distinct architectural approaches for agent design. The model-native agent approach lets the LLM take full control of the agent loop. The LLM-plus-control-framework approach relies on external engineering mechanisms to tightly manage model behavior. This article analyzes both approaches from two angles: underlying architecture and multi-agent collaboration. It examines their technical differences, tradeoffs, and suitable use cases.

    1. Underlying Architecture: Model-Native vs. External Control Framework

    The key difference is where decision-making authority lives: who decides when the agent should think, invoke a tool, or correct an error.

    Model-Native Agents: The AI Manages Itself

    The core idea is to internalize all agent capabilities—such as tool calling, task decomposition, and state-machine transitions—directly into the model’s training and inference process. In this architecture, the LLM is more than a text generator; it is a complete control center with perception and action capabilities.

    Technically, the system usually consists of a strong foundation model and a fixed set of tools, with no separate external scheduler. After receiving a high-level goal from the user, the model autonomously decides when to issue function calls (for example, reading files or executing commands) and when to perform chain-of-thought reasoning.

    The main advantage is high execution efficiency and end-to-end fluency. The model can perceive context and react continuously with low latency. However, because control is entirely delegated to the model, its behavioral boundaries are difficult to enforce through engineering. In some complex scenarios, it may take autonomous actions that do not match expectations.

    LLM + Control Framework: Humans Manage AI

    This approach is currently a mainstream choice for many open-source AI coding tools. It treats the LLM only as a code-generation and code-understanding engine and builds an independent, transparent control and scheduling system around it.

    Technically, this is like adding a “project manager” outside the model. The external framework handles prompt orchestration, context management, tool permission assignment, and error-retry logic. The LLM produces a text response in a specified format only when invoked by the external system; it has no authority to initiate actions on its own.

    This architecture gives developers high visibility and controllability. External configuration can precisely constrain each step, making it well suited to enterprise scenarios that require strict compliance review. The downside is that the orchestration logic can become a performance bottleneck. In addition, rapid iteration in model capabilities raises the cost of adapting the external framework.

    2. Multi-Agent Collaboration: Fixed Roles vs. Dynamic Generation

    Complex software engineering tasks often cause single-agent architectures to suffer from excessive context length and diluted attention. Multi-agent collaboration has therefore become a key way to handle complex work. The two architectural paths also differ significantly in multi-agent design.

    Fixed-Role Dual-Main-Agent Architecture

    Represented by the LLM-plus-control-framework path, this architecture’s key innovation is the engineered separation of thinking and execution. It typically uses two main agents plus lightweight subagents.

    • Plan agent (planning): Strictly read-only. It analyzes the current codebase, writes technical plans, and performs architecture design. It is not allowed to trigger any system call that modifies files. This permission isolation prevents accidental changes to the codebase during planning.
    • Build agent (execution): Holds only execution permissions. Its sole responsibility is to implement code and run tests strictly according to the plan document produced by the Plan agent. It cannot change the established technical plan on its own.
    • Collaboration model: The two main agents usually exchange information through the file system (for example, Markdown design documents). Because the information is persisted, developers can interrupt at any point between the two phases and manually review or modify the plan. This predefined-role model provides tight behavioral control, but it sacrifices flexibility when facing unfamiliar scenarios.

    Dynamically Generated Multi-Agent Architecture

    The model-native path goes further in multi-agent collaboration by introducing dynamic workflow orchestration.

    • On-demand subagent generation: By default, it behaves as a general-purpose single main agent that plans and executes routine tasks autonomously. When a highly complex task appears, the model can write code to dynamically instantiate specialized subagents. Every dynamically generated subagent has its own context window and specific tool permissions.
    • Dynamic workflow orchestration: More radically, the model can not only create subagents but also define the collaboration topology between them by generating code. Whether they operate as a serial pipeline, parallel batch processing, or a multi-model voting system is decided by the model based on the characteristics of the current task.
    • Technical characteristics: This fully decentralized architecture with no predefined roles offers extreme flexibility and can accommodate unusual business requirements. At the same time, the model may generate unnecessarily complex subagent structures for simple tasks, leading to a surge in token consumption and higher response latency.

    3. Architecture Selection and Engineering Practices

    In enterprise development, choosing an agent architecture requires weighing business continuity, security and compliance requirements, and development cost.

    1. Security-first scenarios: In finance, healthcare, and other domains with extremely strict requirements for code changes, the LLM-plus-control-framework path is recommended. Through Plan/Build separation and persistent intermediate state on the file system, enterprises can introduce strict code review processes and ensure that every AI code submission remains under human oversight.
    2. Innovation and exploration scenarios: For startups, prototype validation, and internal tooling, model-native agents can significantly improve development efficiency. Developers only need to describe the desired outcome, and the AI explores implementation paths autonomously, enabling rapid experimentation.
    3. Practices with cloud-native infrastructure: Whichever architecture is used, stable operation of AI coding tools depends on cloud infrastructure. When building an enterprise agent platform, teams should use a container platform to isolate code execution environments and prevent untrusted code from damaging the host. They should also integrate professional logging, monitoring, and alerting systems to track API call frequency, token consumption, and error rates in real time. For example, with the general-purpose cloud computing and storage services provided by Baidu AI Cloud, developers can focus more on optimizing agent scheduling logic without having to worry about the stability of underlying resources.

    In summary, external control frameworks and model-native agents are not absolute opposites. As the control capabilities of large models improve and external engineering frameworks become more intelligent, the two are already borrowing from each other. Future AI coding assistants may preserve the fluency of model-native operation at the foundation while retaining hard external intervention at critical nodes. This would allow them to find a better balance between autonomy and controllability.