Skip to main content

Module runtime

Module runtime 

Source
Expand description

Harness runtime facade.

AgentHarness is the single composed runtime that every level of the recursion runs inside: a sub-agent, a subgraph node, a REPL session, or a model-authored blueprint all execute on the same harness — the same model and tool registries, middleware stack, and RunPolicy. That shared, re-entrant runtime is what makes “agents calling agents” and self-authored workflows recurse on one consistent set of capabilities rather than spinning up disjoint engines.

Owns the high-level AgentHarness builder and the RunPolicy bundle that wires registries, middleware, and run policy into a single ergonomic entry point. The agent loop driven by this facade lives in the sibling crate::harness::agent_loop module.

§Layout

  • [types] holds the public type definitions (RunPolicy and AgentHarness).
  • This file holds the builder, registration, and accessor methods.
  • test.rs holds focused tests for construction and registration.

Structs§

AgentHarness
High-level facade that composes model selection, tool execution, middleware, and run policy behind one builder and runs the default agent loop.
PayloadCapture
Controls whether the agent loop captures model and tool payloads (prompt/completion text, tool arguments/results) onto the AgentEvent::ModelCompleted and AgentEvent::ToolCompleted events it emits.
RunPolicy

Enums§

InvalidArgsPolicy
How the agent loop reacts when the model calls a registered tool with arguments that fail schema validation.
UnknownToolPolicy
Declarative, run-scoped policy shared by every invocation of an AgentHarness.