All-Plugin Architecture: The Design Philosophy Behind Next-Generation Agent Runtime Frameworks

    This article explores the design philosophy of a new generation of agent runtime frameworks built on a fully pluggable architecture. It explains why modern agents are best understood as "Agent = Model + Runtime," contrasts the all-plugin model with the traditional "core + extensions" approach, breaks down the three-layer Turn-Step-Tool lifecycle and its event-driven extension mechanism, and offers practical engineering advice for teams building custom agents on such a foundation.

    All-Plugin Architecture: The Design Philosophy Behind Next-Generation Agent Runtime Frameworks

    Why We Need to Rethink the Shape of Agent Frameworks

    Over the past two years, the reasoning capabilities of large language models have advanced rapidly, but a broad engineering consensus has emerged: the model is only responsible for “thinking”—what actually makes an agent run is the entire engineering system around it. How context is organized, how tools are dispatched, how files are read and written, how shell commands are executed, how tasks are decomposed, how failures are recovered from, and how sessions are persisted—the quality of these capabilities often determines an agent’s real-world performance more than differences between models themselves.

    The industry often summarizes this division of labor with a simple formula:

    1. Agent = Model + Runtime

    The model handles reasoning and generation, while the runtime (also commonly called the harness) handles execution and orchestration. Once you understand this, it’s easy to see why a new class of open-source agent runtime frameworks has attracted widespread community attention: they no longer position themselves as fixed-function coding assistants, but as freely composable agent runtime foundations. The coding scenario is merely an official preset combination of plugins. Developers can use the same foundation to assemble an ops agent, a data analysis agent, or even a domain-specific agent that has nothing to do with programming.

    “Everything Is a Plugin”: An Architecture with No Privileged Core

    The most distinctive design of this kind of framework is its thoroughly plugin-based architecture. It is built on top of a low-level plugin runtime (a meta-framework) that is only responsible for plugin registration, loading, lifecycle scheduling, and event dispatch. Everything else—including the agent loop, model adapters, session storage, the tool registry, and the interactive interface—exists as plugins. There is no hard-coded privileged core.

    This stands in sharp contrast to the traditional “core + extensions” model:

    Dimension All-Plugin Architecture Core + Extensions Architecture
    Core loop Itself a plugin, replaceable Fixed in an immutable kernel
    Model adaptation Provided by plugins, swappable Built-in adapter layer with limited extensibility
    Session storage Provided by plugins Built into the core
    Tool registration Provided by plugins Mounted around the core’s periphery
    UI interaction Provided by plugins Coupled to the core

    The essence of this difference is that plugins are native components of the framework, not bolt-on capability patches. In the “core + extensions” model, plugins behave like auxiliary utilities inside the main program, with their scope pre-defined by the core. In the all-plugin model, even “how the agent operates” can itself be replaced—you can swap out the default loop strategy and implement your own plan-execute-reflect paradigm without forking the entire repository.

    A Three-Layer Lifecycle: Turn → Step → Tool

    To support fine-grained extension capabilities, the framework abstracts a conversational task into three nested layers of state:

    • Turn: A complete user task picked up by the agent—the outermost layer of the lifecycle.
    • Step: A single model request along with the messages or tool calls it produces. One Turn may contain multiple Steps.
    • Tool: The execution of a single structured capability, internally divided into pre-call, execution, and post-call processing chains.

    A typical execution chain looks like this:

    1. turn/start → agent/pre-step → step/start
    2. → assemble system prompt and tool schemas
    3. → llm/stream (streaming generation)
    4. → assistant/message
    5. → tool/call
    6. → tools/pre-execute (guard / approval / sandbox)
    7. → tools/execute
    8. → tools/post-execute
    9. → tool/result
    10. → step/end → turn/end

    The value of this layering is that it gives plugins semantically clear, appropriately granular intervention points. Every critical node emits an event, and plugins insert logic by subscribing to events—without modifying any source code in the main loop. Here’s an illustrative example:

    1. // Pseudocode: extending behavior through event subscription
    2. plugin.setup(ctx => {
    3. // Compress context before the model request
    4. ctx.on('agent/pre-step', async (event, next) => {
    5. event.messages = await compressIfNeeded(event.messages);
    6. return next();
    7. });
    8. // Request human approval before tool execution
    9. ctx.on('tools/pre-execute', async (event, next) => {
    10. const approved = await requestApproval(event.tool);
    11. if (!approved) return { skipped: true };
    12. return next();
    13. });
    14. });

    As shown, ctx.on() declares the point of interest, while next() controls whether the flow continues down the chain. This middleware-style chained structure allows multiple plugins to stack on the same node, each fulfilling its own responsibility.

    Typical Extension Scenarios for Each Event Hook

    With this mechanism in place, many capabilities that are difficult to achieve in a fixed architecture become natural:

    1. Context compression: Listen for the pre-model-request event; when conversation history approaches the context window limit, automatically summarize or trim it to avoid the information loss caused by hard truncation.
    2. Observability and telemetry: Subscribe to streaming generation and tool call events, and uniformly report metrics such as latency, token consumption, and tool success rates to monitoring and alerting systems.
    3. Security approval and sandboxing: Intercept high-risk operations before tool execution (such as deleting files or running arbitrary commands), requiring human confirmation or execution in an isolated environment.
    4. Result post-processing: Standardize, redact, or trim tool results before they are written back to the model, ensuring the context the model receives is clean and consistent.
    5. Session persistence and recovery: Write state to storage when a Turn ends, enabling checkpoint-based resumption after a task is interrupted.

    Notably, these capabilities are orthogonal to one another and can be freely combined—this is the compounding effect of the “no privileged core” design.

    Practical Recommendations for Engineering Teams

    For teams planning to build their own agents on top of this kind of foundation, here are a few suggestions:

    • Define plugin boundaries early: Design the parts that will change (model providers, storage backends, approval policies) as plugins, and distill the stable contracts (event semantics, context protocols) into interface specifications.
    • Favor events over intrusion: When a customization need arises, look first for an appropriate event hook rather than modifying the loop logic directly—otherwise, upgrading the foundation will incur high merge costs.
    • Compose with general-purpose cloud capabilities: In production deployments, plugin-generated logs can be sent to a logging service, long-running task state can be stored in object storage, task distribution can be handled through a message queue, and elastic scaling can be achieved with a container platform—these are all generic cloud product categories, decoupled from the framework itself.
    • Pay attention to secure defaults: Guard and approval plugins in the tool execution chain should be enabled by default, especially in scenarios involving file system and terminal operations.

    Conclusion

    The real lesson of the new generation of agent runtime frameworks lies not in any specific feature, but in an architectural philosophy: handing over the very definition of “how an agent works” to plugins. When the loop, adapters, storage, and interface all become replaceable first-class citizens, the framework evolves from “a tool” into “fertile ground.” For developers, understanding the Turn-Step-Tool lifecycle model and the event-driven extension mechanism is a key step toward mastering this kind of foundation and building the next generation of agent applications.