Expand description
Runner module - thin execution shell
The runner is a thin orchestration layer that:
- Accepts invocations
- Passes to Kernel
- Wires callbacks
- Returns streams
Core execution logic lives in the kernel module. Context types are in the context module.
§CRITICAL INVARIANT: Runner Never Mutates State
Runner is a thin orchestration shell. All execution semantics live in kernel/.
Runner MUST NOT:
- Mutate execution state directly
- Retry steps (kernel handles retries)
- Handle backoff (kernel handles backoff)
- Skip nodes (kernel handles node execution)
If Runner starts doing these things → duplicated kernel logic (architectural leak).
What Runner Does:
- Wires services (session, memory, artifacts)
- Handles callbacks (before/after hooks)
- Delegates execution to ExecutionKernel
- Streams events to clients
What Runner Does NOT Do:
- Mutate execution state directly
- Implement execution semantics
- Make policy decisions
@see docs/TECHNICAL/01-EXECUTION-TELEMETRY.md @see docs/TECHNICAL/25-STREAM-PROCESSORS.md
Re-exports§
pub use approval_policy::AlwaysApprovePolicy;pub use approval_policy::AlwaysRequireApprovalPolicy;pub use approval_policy::ApprovalPolicy;pub use approval_policy::ApprovalPolicyConfig;pub use approval_policy::CompositeApprovalPolicy;pub use approval_policy::PatternApprovalPolicy;pub use approval_policy::ThresholdApprovalPolicy;pub use crate::kernel::run_parallel;pub use crate::kernel::InterruptDecision;pub use crate::kernel::InterruptReason;pub use crate::kernel::InterruptableRunner;pub use crate::kernel::ParallelResult;pub use crate::context::InvocationContext;pub use crate::context::InvocationServices;pub use crate::context::ResourceLimits;pub use crate::context::RuntimeContext;pub use crate::context::RuntimeContextBuilder;pub use crate::context::SessionContext;pub use crate::context::TraceContext;pub use callbacks::AfterAgentCallback;pub use callbacks::AfterModelCallback;pub use callbacks::AfterToolCallback;pub use callbacks::AgentCallbackContext;pub use callbacks::AgentCallbackResult;pub use callbacks::BeforeAgentCallback;pub use callbacks::BeforeModelCallback;pub use callbacks::BeforeToolCallback;pub use callbacks::CallbackRegistry;pub use callbacks::ExecutionCallbacks;pub use callbacks::ModelCallbackContext;pub use callbacks::ModelCallbackResult;pub use callbacks::NoOpCallbacks;pub use callbacks::ToolCallbackContext;pub use callbacks::ToolCallbackResult;
Modules§
- approval_
policy - Approval policy for human-in-the-loop plan approval
- callbacks
- Runner Callbacks - Before/after hooks for agents, models, and tools
Structs§
- Agentic
Loop - The agentic loop driver
- Agentic
Loop Result - Result of agentic loop execution
- Discovered
Step - A discovered step parsed from callable output
- Discovery
Output - Result of parsing callable output for discovery signals
- Input
Blocked Error - Error returned when input is blocked by processors
- Protected
Runner - Protected Runner
- Runner
- Runner - executes agents/graphs with abort, pause, and event streaming
Type Aliases§
- Default
Protected Runner - Protected Runner with in-memory checkpoint store (default)
- Default
Runner - Runner with in-memory checkpoint store (default)