pub struct ResolvedAgent {
pub spec: Arc<AgentSpec>,
pub upstream_model: String,
pub tools: HashMap<String, Arc<dyn Tool>>,
pub llm_executor: Arc<dyn LlmExecutor>,
pub tool_executor: Arc<dyn ToolExecutor>,
pub context_summarizer: Option<Arc<dyn ContextSummarizer>>,
pub background_manager: Option<Arc<BackgroundTaskManager>>,
pub stream_checkpoint_store: Option<Arc<dyn StreamCheckpointStore>>,
pub env: ExecutionEnv,
}Expand description
A fully resolved agent: all capabilities + plugin environment, ready to run.
Produced by AgentResolver::resolve(). Contains live references
(LlmExecutor, tools, plugins) — not serializable.
Fields§
§spec: Arc<AgentSpec>The source agent specification.
upstream_model: StringActual model name sent to the upstream provider.
tools: HashMap<String, Arc<dyn Tool>>§llm_executor: Arc<dyn LlmExecutor>§tool_executor: Arc<dyn ToolExecutor>§context_summarizer: Option<Arc<dyn ContextSummarizer>>Context summarizer for LLM-based compaction. None disables LLM compaction
(hard truncation still works if context_policy is set).
background_manager: Option<Arc<BackgroundTaskManager>>Background task manager used to run context compaction off the
main agent loop. None falls back to no compaction (compaction is
only triggered when both this and context_summarizer are set).
stream_checkpoint_store: Option<Arc<dyn StreamCheckpointStore>>Optional store for cross-process stream resume. When Some, the
loop runner flushes mid-stream accumulator snapshots to this
store and restores from it on the next execute_streaming call
that targets the same run. None disables cross-process resume
entirely (in-process retry still works via the normal R1-R4 loop).
env: ExecutionEnvPlugin-provided behavior (hooks, handlers, transforms).
Implementations§
Source§impl ResolvedAgent
impl ResolvedAgent
Sourcepub fn new(
id: impl Into<String>,
upstream_model: impl Into<String>,
system_prompt: impl Into<String>,
llm_executor: Arc<dyn LlmExecutor>,
) -> ResolvedAgent
pub fn new( id: impl Into<String>, upstream_model: impl Into<String>, system_prompt: impl Into<String>, llm_executor: Arc<dyn LlmExecutor>, ) -> ResolvedAgent
Create a minimal ResolvedAgent (for tests).
Sourcepub fn with_stream_checkpoint_store(
self,
store: Arc<dyn StreamCheckpointStore>,
) -> ResolvedAgent
pub fn with_stream_checkpoint_store( self, store: Arc<dyn StreamCheckpointStore>, ) -> ResolvedAgent
Attach a stream checkpoint store (builder-style). Enables cross-process
resume: mid-stream accumulator snapshots will be flushed here and
restored by the next execute_streaming call for the same run_id.
pub fn id(&self) -> &str
pub fn model_id(&self) -> &str
pub fn system_prompt(&self) -> &str
pub fn max_rounds(&self) -> usize
pub fn context_policy(&self) -> Option<&ContextWindowPolicy>
pub fn max_continuation_retries(&self) -> usize
pub fn with_tool_executor( self, executor: Arc<dyn ToolExecutor>, ) -> ResolvedAgent
pub fn with_max_rounds(self, max_rounds: usize) -> ResolvedAgent
pub fn with_tool(self, tool: Arc<dyn Tool>) -> ResolvedAgent
pub fn with_tools(self, tools: Vec<Arc<dyn Tool>>) -> ResolvedAgent
pub fn with_context_policy(self, policy: ContextWindowPolicy) -> ResolvedAgent
pub fn with_context_summarizer( self, summarizer: Arc<dyn ContextSummarizer>, ) -> ResolvedAgent
Sourcepub fn with_background_manager(
self,
manager: Arc<BackgroundTaskManager>,
) -> ResolvedAgent
pub fn with_background_manager( self, manager: Arc<BackgroundTaskManager>, ) -> ResolvedAgent
Attach a background task manager so context compaction can run off the main agent loop. Without this, compaction is disabled even if a summarizer is configured.
pub fn with_max_continuation_retries(self, n: usize) -> ResolvedAgent
pub fn tool_descriptors(&self) -> Vec<ToolDescriptor>
Trait Implementations§
Source§impl Clone for ResolvedAgent
impl Clone for ResolvedAgent
Source§fn clone(&self) -> ResolvedAgent
fn clone(&self) -> ResolvedAgent
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more