trusty_code/runner/mod.rs
1//! Runtime execution layer: the in-process agent runner (issue #1029).
2//!
3//! Why: The PM's `delegate_to_agent` tool needs a concrete `AgentRunner` that
4//! actually executes a sub-agent. The M1 model-comparison harness runs that
5//! sub-agent *in-process* — same process as the PM — so a delegation cycle is
6//! cheap, deterministic to observe, and lets the sub-agent's token usage accrue
7//! onto the same shared LLM client (and thus the PM's transcript). This module
8//! is that runner plus its DI seams.
9//! What: Re-exports `InProcessAgentRunner` (implements `crate::tools::AgentRunner`),
10//! the `RegistryFactory` trait (how a sub-agent's tools are assembled),
11//! `InProcessRunnerConfig` (default loop budget), `RunnerError` (structured
12//! library error), and the `agent_config_exists` helper.
13//! Test: `runner::tests::*` cover the full delegation path offline via a
14//! scripted `LlmClientTrait` mock.
15
16mod error;
17mod in_process;
18
19#[cfg(test)]
20mod tests;
21
22pub use error::RunnerError;
23pub use in_process::{
24 InProcessAgentRunner, InProcessRunnerConfig, RegistryFactory, agent_config_exists,
25};