Deconstructing Open-Source AI Agent Runtime Architecture: Layers, Interfaces, and Trajectories
This article breaks down the architecture of an open-source AI agent runtime (referred to as DSH) released alongside a new model. It explains why community expectations diverged from the delivered artifact, maps its five access interfaces and seven decoupled layers, and covers local deployment, default presets, and the read-only trajectory mechanism built on session event logs. It also outlines a controlled comparison method and a full-stack validation task, then offers selection guidance for teams building agent infrastructure versus users seeking a ready-made coding tool.
1. Background: A Structural Mismatch Between Expectation and Artifact
An open-source AI agent runtime (referred to as DSH throughout this article) published its source code on the same day a new generation model was officially released. Before that, the model’s technical documentation had mentioned the runtime only by its abbreviation, and the community had been building anticipation for months. Once the code was public, a clear mismatch emerged between external expectations and the actual deliverable: most people expected a mature, out-of-the-box agentic coding tool, while what was delivered looks more like an open runtime for continuing to construct agents.
This mismatch is not a quality problem but a positioning difference. A mature product packages capabilities inside a fixed interaction shell, and users receive conclusions. An open runtime breaks capabilities into replaceable parts, and users receive the conditions for construction. Understanding this is the prerequisite for assessing its completeness.
Community feedback has therefore split in two:
| User group | Core need | Technical focus |
|---|---|---|
| End users | A mature agentic coding tool | Desktop client, terminal experience, cross-platform compatibility, cache hit rate, everyday coding productivity, the upper bound of runtime gains over the model |
| Platform developers | Extensible agent infrastructure | Plugin system, preset combinations, trajectory observability, runtime self-modification |
Both sets of needs are legitimate, because the runtime carries a dual identity. But completeness is structurally asymmetric: openness at the runtime layer is already fairly mature, while the default product experience has not caught up with established end-user solutions in the field.
2. Form: Five Interfaces and Seven Decoupled Layers
In technical form, DSH exposes five access methods: a browser-based coding interface, a headless command-line entry point, a scripting-language SDK, an agent communication protocol, and a general-purpose JSON-RPC interface. All five share the same kernel; they differ only in the transport and presentation layers.
Inside the kernel, the system can be split into seven layers, and the layers are coupled by contracts rather than inheritance:
- Model provider: handles wrapping inference requests, retries, and stream parsing;
- Tool set: a registry of atomic capabilities such as file read/write, command execution, and retrieval;
- Session management: persistence of messages, events, and state;
- Permission policy: decides whether a given tool call is allowed;
- Sandbox execution: provides an isolation boundary for commands and code;
- Agent loop: the driving logic for planning, calling, observing, and replanning;
- Interface layer: projects kernel state into readable views.
The practical value of decoupling lies in replacement cost. Swapping the model provider for another inference service requires only implementing the unified adapter interface; switching the interface layer from browser to terminal requires no kernel changes. A schematic view:
[UI / CLI / SDK / RPC]|Agent Loop <----> Preset (prompt + tool allowlist + policy)|+------+------+| |Tool Registry Session Log| |Sandbox Trajectory (read-only projection)
3. Local Deployment Notes for the Entry Points
The minimal path to local deployment is to install via a package manager, start the headless entry point, and then connect through the browser interface or a script. Four points deserve attention in practice:
- Keep runtime dependencies separate from model credentials; inject credentials through environment variables and never write them into the project directory;
- Declare the workspace directory explicitly to avoid the agent’s retrieval scope overstepping bounds;
- The headless entry point suits integration into CI pipelines, with output primarily as a structured event stream;
- The scripting-language SDK suits embedding the agent into existing services while reusing the same session store.
The entry points share configuration, so there is no capability gap such as “the CLI works but the interface does not”; differences show up only in how rich the interaction feedback is.
4. Default Configuration: Collapsing Tunables into Presets
The default configuration follows a “usable first, modifiable second” design. It typically includes a set of presets, each binding a prompt template, a tool allowlist, a permission tier, and a sandbox scope. Users do not tune parameters one by one; they simply select a preset, and override specific fields only when deep customization is needed.
This layering brings two benefits: newcomers will not break security boundaries through misconfiguration, and experts can form team-level standard operating configurations without touching the kernel.
5. The Trajectory Mechanism: A Read-Only Projection of the Session Event Log
Community assessment of the runtime information panel matches the source design closely. Its core constraint is a single sentence: content visible to the model must already be persisted to the log.
From this follows the positioning of the trajectory: it is not an independently instrumented monitoring system, but a read-only projection generated directly from the session event log (zstd-compressed JSONL). The event log is the single source of truth, and metrics on the interface such as cache hits, input/output token distribution, and token rate are all re-aggregations of the log.
The engineering significance of this design is threefold:
- Consistency: what the interface shows is strictly consistent with what the model actually saw, with no race where “the log has not been written but the panel lights up first”;
- Replayability: the compressed JSONL can be analyzed offline, so reproducing an issue does not depend on the original environment;
- Extensibility: adding a metric requires only adding projection logic, without intruding into the execution path.
6. Controlled Comparison: Trajectory Differences Under the Same Model
To observe the runtime’s own influence, fix the same third-party model, run the same task on two agentic coding solutions, and compare the event sequences rather than the final code. Suggested observation dimensions include: the number of planning steps before the first tool call, the number of times the same file is read repeatedly, the retry strategy after a failed command, and when context compaction is triggered.
It should be emphasized that such comparisons can only show the boundaries of difference and capability thresholds. Data from a single local run does not constitute a basis for product ranking, as it is significantly affected by network fluctuation, cache state, and prompt wording.
7. Full-Stack Task Validation
Finally, run a full-stack task that produces a visual artifact using a model with a higher capability ceiling: requirement breakdown, data model and interface design, frontend pages and chart rendering, starting a local service for verification, generating a preview image, and writing it into the documentation. The checkpoints are whether the runtime can keep the goal from drifting across multiple rounds of tool calls, and whether it can complete the build and self-test inside the sandbox.
8. Conclusion and Selection Guidance
DSH is currently in a developer preview stage and suits two scenarios: teams that need to build their own agent infrastructure can reuse its decoupled kernel and log projection mechanism; users seeking an out-of-the-box experience should wait for the default product experience to be completed, or wrap their own interface on top of it.
If an enterprise wants to deploy a similar architecture on Baidu AI Cloud, it can combine general-purpose capabilities: a container platform to host the runtime, object storage to keep session archives, and log service plus monitoring and alerting to carry trajectory metrics, thereby obtaining a complete observability loop without binding to proprietary interfaces.
