Composable Agent Harness in Space and Time: A Practical Guide

    This article explains how to make an AI agent harness composable across both time and space. It covers why long-running agents break traditional runtime assumptions, why plugin systems, container orchestration, and process isolation rely on costly coarse-grained restarts, and how separating runtime changes into two orthogonal dimensions enables fine-grained hot updates and transactional rollback. You will find a minimal kernel-plus-plugin architecture, plugin contracts, a hot-swap workflow, and key engineering constraints for building an evolvable agent foundation.

    1. Why Long-Running Agents Demand More from the Harness

    Early agent applications mostly stayed at the stage of “single-turn prompt calls.” Their runtime behaved like a stateless function call: take context as input, return a result, and exit. Once agents began handling long-running tasks, coordinating multiple tools, and evolving themselves, those runtime assumptions no longer held. The agent harness is no longer just a shell that loads prompts and models. It must be a long-running environment that carries state, connections, tool topology, and version evolution.

    The requirements fall into three areas.

    First, dynamic scaling and plug-and-play tools. Agents need to generate, load, or unload external tools and third-party services at runtime based on the current task. The tool set becomes a mutable topology rather than a fixed list determined at compile time.

    Second, self-modification and lossless hot updates. When an agent can write code autonomously and fix defects in existing tools, updates must take effect in place without interrupting the current session or losing accumulated memory and connection caches. Any “restart and restore” approach breaks the continuity of long-running tasks.

    Third, fault tolerance and transactional rollback. Model-generated code can naturally contain syntax errors and logic exceptions. The harness must provide database-like atomicity: a change either takes effect as a whole or is withdrawn as a whole, and a failure must not pollute existing state or bring down the host process.

    2. Why Existing Approaches Fall Short: The Cost of Coarse-Grained Restarts

    Common industry approaches fall into three categories: plugin systems like those in AI coding tools, container and microservice orchestration, and process-level isolation. All are mature and reliable, but they share the limitation of “coarse-grained restarts” when facing the requirements above.

    • Unloading or updating a plugin often requires restarting the entire host process, which discards session memory.
    • Container rebuilds introduce startup latency and cold-start jitter that long-running tasks can hardly tolerate.
    • Process and container boundaries provide isolation but cannot express fine-grained topology dependencies within the same address space.
    • Rollback granularity is tied to deployment granularity, so there is no way to precisely undo “a single capability change.”

    As a result, capability evolution is bound to the deployment cadence, and an agent’s “self-evolution” degrades into “manual releases.”

    3. Theoretical Abstraction: Splitting Dynamic Composition into Two Orthogonal Dimensions

    A more rigorous approach is to formalize the dynamic composition problem along two orthogonal dimensions. This is the core claim of space-time composability.

    The time dimension concerns “when to change and how a change takes effect atomically.” It requires changes to be schedulable, rollback-capable, and state-consistent. This is equivalent to introducing transactional semantics at runtime: a change is wrapped as a unit that can be committed or revoked, remains invisible externally before commit, and returns the system to an equivalent pre-change state after rollback.

    The space dimension concerns “who hosts a capability and how dependencies are organized.” It requires every capability to exist as a plugin, with plugins forming a directed topology through explicit dependency declarations. Load order, visibility scope, and resource boundaries can all be derived statically and validated dynamically.

    The two dimensions being orthogonal means that topology adjustments in space need not come at the cost of restarts in time, and version evolution in time need not change the dependency structure in space. This is the theoretical prerequisite for fine-grained hot updates and transactional rollback to hold at the same time.

    4. Architecture in Practice: An All-Plugin Host Kernel

    Turning the theory into engineering yields a structure with a minimal kernel and a plugin ecosystem. The kernel only handles lifecycle scheduling, dependency resolution, and transaction coordination. It carries no business capability.

    1. Kernel
    2. ├── DependencyResolver Resolves plugin dependency topology; detects cycles and missing entries
    3. ├── LifecycleScheduler Manages the assemble/start/stop/unload state machine
    4. ├── TransactionCoordinator Commits or revokes a change
    5. └── StateSnapshot Pre-change state snapshot and restore
    6. Plugins
    7. ├── tool:search dependsOn: []
    8. ├── tool:memory dependsOn: [core.state]
    9. └── agent:planner dependsOn: [tool:search, tool:memory]

    An illustrative plugin declaration and hot-update flow:

    1. # Plugin contract: declarative dependencies + explicit lifecycle hooks
    2. class Plugin:
    3. name: str
    4. depends_on: list[str] = []
    5. def setup(self, ctx): ... # Assemble: request resources, register capabilities
    6. def commit(self): ... # Commit: make the change externally visible
    7. def rollback(self): ... # Rollback: restore to the snapshot state
    8. # Transactional hot update: build the new version first, then switch atomically
    9. def hot_swap(kernel, name, new_plugin):
    10. tx = kernel.begin_transaction()
    11. try:
    12. old = kernel.get(name)
    13. new_plugin.setup(kernel.context_for(name))
    14. kernel.replace(name, new_plugin) # Atomic topology switch
    15. tx.commit()
    16. old.stop()
    17. except Exception:
    18. tx.rollback() # Rollback of both semantics and state
    19. raise

    There are three key design points. First, dependency declarations are data rather than code, so they can be validated statically. Second, state is separated from capability, and snapshots cover only the session state and connection caches that need to persist. Third, rollback is a path rather than exception handling, and it must be validated at design time.

    5. Engineering Constraints and Common Pitfalls

    • Dependencies must be acyclic and explicit; implicit global singletons destroy unloadability.
    • State must be serializable or snapshot-capable; plugins holding unrecoverable handles are hard to hot update.
    • Transaction boundaries should be small enough; overly large boundaries make rollback costly, while overly small ones make consistency hard to guarantee.
    • Set up canary releases and observability, using general-purpose logging services and monitoring alerts to verify the effect of changes.
    • Model-generated code should be validated in a restricted sandbox before commit, and any failure should revoke the change as a whole.

    6. Conclusion

    An agent’s true self-evolution does not depend on whether the model can write code, but on whether the harness can safely accept changes. Breaking dynamic composition into two orthogonal dimensions, time and space, using a plugin topology to carry capabilities and transactional semantics to safeguard changes, allows long-running execution, lossless hot updates, and precise rollback to hold at the same time. This paradigm is independent of any specific product. It is a general engineering path for building an evolvable agent foundation, and it can work with general cloud capabilities such as container platforms and object storage to form a complete runtime and governance loop.