Deconstructing Open Runtime Architecture: Designing Agent Infrastructure

    This article breaks down the architecture of an open Runtime for AI agents, shifting the focus from finished coding tools to extensible infrastructure. It explains how decoupling the model provider, tools, session management, permissions, sandboxing, agent loop, and UI enables flexible composition; why multiple entry points (package manager, web, headless CLI, and multi-language SDK) separate the interaction layer from the execution layer; and how default configurations and a persisted session log establish reproducibility. It further clarifies that trajectories are read-only projections of the session log, outlines a controlled experiment for comparing Runtime implementations under the same model, and demonstrates a full-stack task with visual artifacts to verify state consistency, permission control, and traceability. The conclusion offers evaluation criteria for teams building their own agent platforms.

    1. From Finished Tools to an Open Runtime

    As intelligent coding tools evolve quickly, expectations for a “coding agent” often center on desktop experience, terminal interaction, platform compatibility, and everyday coding efficiency. However, a more infrastructure-oriented form is emerging: instead of positioning itself as a fixed product, it provides an open Runtime that can be used to build further agents.

    Its defining characteristic is decoupling: the model provider, tool set, session management, permission policies, sandbox execution, agent loop, and UI layer are separated so each can be replaced and recombined on demand. For end users, it may not yet deliver a mature, all-in-one experience. For platform developers, it exposes extension points such as a plugin system, composable presets, trajectory observability, and runtime self-modification.

    Understanding this kind of architecture, therefore, is not about a simple “is it easy to use” comparison. It is about judging whether the structure meets the requirements of extensible agent infrastructure.

    2. Four Entry Points: The Engineering Value of Multiple Access Modes

    A mature Runtime typically needs to cover multiple invocation scenarios. Four common entry points are:

    • Package manager entry: quick integration and debugging within a local project;
    • Web interaction entry: visual orchestration and result preview;
    • Headless CLI entry: suitable for automation scripts, batch tasks, and pipeline integration;
    • Multi-language SDK entry: lets upper-layer business systems drive the agent programmatically.

    The value of multiple entry points is that they separate the “interaction layer” from the “execution layer.” Whether a user works through a graphical interface, a terminal, or code, everything converges into a unified session and execution kernel. This design reduces duplicated build effort and lets the same permission and logging system be reused.

    3. Default Configuration and Session Log: The Basis of Reproducibility

    Default configuration determines the out-of-box experience, while the session log determines reproducibility. One constraint worth borrowing is: whatever the model can see must already be persisted to the log.

    This means the log is not monitoring data recorded after the fact, but the runtime’s source of truth. A compressed, line-by-line JSON format is typically used to store session events, balancing write throughput and storage cost. The direct benefits are:

    1. Any execution can be replayed;
    2. Problem diagnosis no longer relies on verbal descriptions;
    3. The context construction process can be audited.

    An illustrative log structure:

    1. {"ts":1723526400,"type":"message","role":"user","content":"..."}
    2. {"ts":1723526401,"type":"tool_call","name":"read_file","args":{"path":"..."}}
    3. {"ts":1723526402,"type":"tool_result","tokens":1024,"cache_hit":true}

    4. Trajectories Are a Read-Only Projection of the Log

    A trajectory is often compared to an agent’s debug panel, exposing metrics such as cache hits, input/output tokens, and token rate in real time. Architecturally, however, it is not an independent monitoring layer with its own instrumentation; it is a read-only projection built from the session event log.

    This design brings three forms of rigor:

    • Single source of truth: the panel and the log never contradict each other;
    • Zero-intrusion observability: observation logic does not intrude on the main execution path;
    • Clear boundaries: the presentation layer can be replaced without affecting historical data.

    For platform developers, this means they can build custom views, aggregate metrics, or connect to general-purpose logging services and monitoring/alerting systems without changing the execution kernel.

    5. Controlled Experiment: Execution Differences Under the Same Model

    To observe architectural differences rather than model differences, a controlled-variable approach works well: fix the same model, switch only the Runtime implementation, and compare the two execution trajectories. Suggested focus areas include:

    • The order of tool calls and the number of retries;
    • Context trimming and cache hit behavior;
    • Recovery strategy after failures;
    • The completeness of auditable information in the trajectory.

    It is worth stressing that results from a single local run are only for observing capability thresholds and difference boundaries; they do not constitute a product ranking. A preview-stage architecture’s performance can change quickly across versions.

    6. A Complex Full-Stack Task: A Closed Loop with Visual Artifacts

    Finally, a complex full-stack task with visual artifacts can test closed-loop capability. Typical stages include:

    1. Requirement breakdown and task orchestration;
    2. Backend API and data model implementation;
    3. Frontend pages and chart rendering;
    4. Producing artifacts such as images or visualization files;
    5. Verifying each step’s intermediate results through log replay.

    This process validates the Runtime’s ability to maintain state consistency, enforce permission control, and ensure result traceability across long-chain tasks.

    7. Conclusion

    An open Runtime and a finished coding tool are not substitutes; they sit at different levels of abstraction. The former centers on decoupling, observability, and recomposability; the latter centers on experience and efficiency. For teams that want to build their own agent platform or pursue deep integration, evaluating entry-point completeness, the log as source of truth, the trajectory projection mechanism, and the sandbox permission model is often more valuable in the long run than a short-term experience comparison. Combined with Baidu AI Cloud’s general-purpose container platform, logging service, and monitoring/alerting capabilities, such a Runtime can be brought into a standardized, operable engineering system.