use std::collections::{BTreeMap, HashSet};
use std::fmt;
use std::path::{Path, PathBuf};
use std::sync::Arc;
use futures::future::BoxFuture;
use strands::background_tasks::BackgroundTasksConfig;
use strands::context_manager::ContextManagerStrategy;
use strands::conversation_manager::ConversationManager;
use strands::hooks::InitializedEvent;
use strands::interventions::InterventionHandler;
use strands::memory::{MemoryManager, MemoryManagerSource};
use strands::plugins::Plugin;
use strands::retry::RetryStrategy;
use strands::sandbox::Sandbox;
use strands::session::{SaveLatestStrategy, SessionManager, SessionManagerConfig};
use strands::storage::{LocalFileStorage, Storage};
use strands::telemetry::AttributeValue;
use strands::tools::{Tool, ToolExecutorStrategy, ToolSource};
use strands::types::{JsonObject, JsonSchema, Message, SystemPrompt, Toggle};
use strands::vended_plugins::skills::{AgentSkills, AgentSkillsConfig, SkillSource};
use strands::{Agent, AgentConfig, ModelSource};
use crate::builtin_tools::{
WebSearchMode, build_builtin_tools, resolve_builtin_tools, web_search_explicit, web_search_mode,
};
use crate::config::BuiltinPluginName;
use crate::defaults::{DEFAULT_BUILTIN_PLUGINS, DEFAULT_MODEL, DEFAULT_SESSION_DIR, DEFAULT_SKILLS_DIR};
use crate::env::Env;
use crate::factory::{BUILTIN_TOOL_FACTORY, BuiltinToolFactory, ENVIRONMENT_PLUGIN_NAME};
use crate::interventions::{InterventionsOption, resolve_interventions};
use crate::memory::{ResolveMemoryOptions, resolve_memory};
use crate::models::{ModelPlan, ModelRequest, resolve_model};
use crate::prompt::build_system_prompt;
use crate::telemetry::setup_telemetry;
use crate::types::{
BuiltinToolsConfig, BuiltinToolsOption, ContextManagerOption, Effort, McpServersOption, MemoryConfig, SessionConfig,
};
const AGENT_SKILLS_NAME: &str = "strands:agent-skills";
const ALWAYS_BACKGROUND_TOOL_NAMES: [&str; 1] = ["subagent"];
#[derive(Clone)]
#[non_exhaustive]
pub enum SessionOption {
Off,
On(SessionConfig),
Manager(SessionManager),
}
impl From<bool> for SessionOption {
fn from(enabled: bool) -> Self {
if enabled {
Self::On(SessionConfig::default())
} else {
Self::Off
}
}
}
impl From<SessionConfig> for SessionOption {
fn from(config: SessionConfig) -> Self {
Self::On(config)
}
}
impl From<SessionManager> for SessionOption {
fn from(manager: SessionManager) -> Self {
Self::Manager(manager)
}
}
impl fmt::Debug for SessionOption {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Self::Off => f.write_str("Off"),
Self::On(config) => f.debug_tuple("On").field(config).finish(),
Self::Manager(manager) => f.debug_tuple("Manager").field(&manager.session_id()).finish(),
}
}
}
#[derive(Debug, Clone)]
#[non_exhaustive]
pub enum SkillsOption {
Off,
Default,
Sources(Vec<SkillSource>),
Plugin(AgentSkills),
}
impl From<bool> for SkillsOption {
fn from(enabled: bool) -> Self {
if enabled { Self::Default } else { Self::Off }
}
}
impl From<SkillSource> for SkillsOption {
fn from(source: SkillSource) -> Self {
Self::Sources(vec![source])
}
}
impl From<&str> for SkillsOption {
fn from(source: &str) -> Self {
Self::Sources(vec![source.into()])
}
}
impl From<String> for SkillsOption {
fn from(source: String) -> Self {
Self::Sources(vec![source.into()])
}
}
impl From<PathBuf> for SkillsOption {
fn from(source: PathBuf) -> Self {
Self::Sources(vec![source.into()])
}
}
impl From<&Path> for SkillsOption {
fn from(source: &Path) -> Self {
Self::Sources(vec![source.into()])
}
}
impl<T: Into<SkillSource>> From<Vec<T>> for SkillsOption {
fn from(sources: Vec<T>) -> Self {
Self::Sources(sources.into_iter().map(Into::into).collect())
}
}
impl<T: Into<SkillSource>, const N: usize> From<[T; N]> for SkillsOption {
fn from(sources: [T; N]) -> Self {
Self::Sources(sources.into_iter().map(Into::into).collect())
}
}
impl From<AgentSkills> for SkillsOption {
fn from(plugin: AgentSkills) -> Self {
Self::Plugin(plugin)
}
}
#[derive(Clone)]
#[non_exhaustive]
pub enum MemoryOption {
Off,
On(MemoryConfig),
Manager(MemoryManager),
}
impl From<bool> for MemoryOption {
fn from(enabled: bool) -> Self {
if enabled {
Self::On(MemoryConfig::default())
} else {
Self::Off
}
}
}
impl From<MemoryConfig> for MemoryOption {
fn from(config: MemoryConfig) -> Self {
Self::On(config)
}
}
impl From<MemoryManager> for MemoryOption {
fn from(manager: MemoryManager) -> Self {
Self::Manager(manager)
}
}
impl fmt::Debug for MemoryOption {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Self::Off => f.write_str("Off"),
Self::On(config) => f.debug_tuple("On").field(config).finish(),
Self::Manager(_) => f.write_str("Manager(..)"),
}
}
}
#[derive(Default, bon::Builder)]
#[builder(builder_type(name = HarnessAgentOptionsBuilder, vis = "pub", doc {
/// Builds [`HarnessAgentOptions`]; the setters are its fields.
}))]
pub struct HarnessAgentOptions {
#[builder(field)]
pub tools: Vec<ToolSource>,
#[builder(field)]
pub plugins: Vec<Arc<dyn Plugin>>,
#[builder(into)]
pub model: Option<ModelSource>,
#[builder(default)]
pub effort: Effort,
#[builder(into)]
pub instructions: Option<String>,
#[builder(into)]
pub mcp_servers: Option<McpServersOption>,
#[builder(into)]
pub builtin_tools: Option<BuiltinToolsOption>,
#[builder(into)]
pub background_tasks: Option<Toggle<BackgroundTasksConfig>>,
pub caching: Option<bool>,
#[builder(into)]
pub context_manager: Option<ContextManagerOption>,
#[builder(into)]
pub session: Option<SessionOption>,
#[builder(into)]
pub skills: Option<SkillsOption>,
#[builder(into)]
pub memory: Option<MemoryOption>,
#[builder(with = |names: impl IntoIterator<Item = BuiltinPluginName>| names.into_iter().collect())]
pub builtin_plugins: Option<Vec<BuiltinPluginName>>,
#[builder(into)]
pub interventions: Option<InterventionsOption>,
#[builder(into)]
pub aux_model: Option<ModelSource>,
#[builder(default)]
pub messages: Vec<Message>,
#[builder(into)]
pub system_prompt: Option<SystemPrompt>,
pub app_state: Option<JsonObject>,
pub model_state: Option<JsonObject>,
pub printer: Option<bool>,
pub retry_strategy: Option<Vec<RetryStrategy>>,
pub structured_output_schema: Option<JsonSchema>,
#[builder(into)]
pub name: Option<String>,
#[builder(into)]
pub description: Option<String>,
#[builder(into)]
pub id: Option<String>,
#[builder(into)]
pub tool_executor: Option<ToolExecutorStrategy>,
pub sort_tools: Option<bool>,
pub conversation_manager: Option<Arc<dyn ConversationManager>>,
pub trace_attributes: Option<BTreeMap<String, AttributeValue>>,
pub baggage_attributes: Option<BTreeMap<String, String>>,
pub sandbox: Option<Arc<dyn Sandbox>>,
pub storage: Option<Arc<dyn Storage>>,
pub session_manager: Option<SessionManager>,
#[builder(into)]
pub memory_manager: Option<MemoryManagerSource>,
}
impl<S: harness_agent_options_builder::State> HarnessAgentOptionsBuilder<S> {
pub fn tools(mut self, tools: impl IntoIterator<Item = impl Into<ToolSource>>) -> Self {
self.tools.extend(tools.into_iter().map(Into::into));
self
}
pub fn plugins(mut self, plugins: impl IntoIterator<Item = impl Plugin>) -> Self {
self.plugins
.extend(plugins.into_iter().map(|plugin| Arc::new(plugin) as Arc<dyn Plugin>));
self
}
}
impl fmt::Debug for HarnessAgentOptions {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_struct("HarnessAgentOptions")
.field("model", &self.model)
.field("effort", &self.effort)
.field("instructions", &self.instructions)
.field("tools", &self.tools)
.field("builtin_tools", &self.builtin_tools)
.field("session", &self.session)
.field("memory", &self.memory)
.field("skills", &self.skills)
.finish_non_exhaustive()
}
}
#[derive(Clone)]
pub(crate) struct ParentConfig {
pub(crate) model: Option<ModelSource>,
pub(crate) effort: Effort,
pub(crate) context_manager: Option<ContextManagerOption>,
pub(crate) skills: Option<SkillsOption>,
pub(crate) memory: Option<MemoryOption>,
pub(crate) tools: Vec<ToolSource>,
pub(crate) builtin_tools: BuiltinToolsConfig,
pub(crate) caching: Option<bool>,
pub(crate) builtin_plugins: Option<Vec<BuiltinPluginName>>,
pub(crate) plugins: Vec<Arc<dyn Plugin>>,
pub(crate) interventions: Option<InterventionsOption>,
pub(crate) background_tasks: Option<Toggle<BackgroundTasksConfig>>,
pub(crate) sandbox: Option<Arc<dyn Sandbox>>,
}
impl ParentConfig {
pub(crate) fn to_options(&self) -> HarnessAgentOptions {
HarnessAgentOptions {
tools: self.tools.clone(),
plugins: self.plugins.clone(),
model: self.model.clone(),
effort: self.effort,
builtin_tools: Some(BuiltinToolsOption::Mapping(self.builtin_tools.clone())),
background_tasks: self.background_tasks.clone(),
caching: self.caching,
context_manager: self.context_manager.clone(),
session: Some(SessionOption::Off),
skills: self.skills.clone(),
memory: self.memory.clone(),
builtin_plugins: self.builtin_plugins.clone(),
interventions: self.interventions.clone(),
sandbox: self.sandbox.clone(),
..Default::default()
}
}
}
pub(crate) fn sanitize_session_id(session_id: &str) -> String {
let sanitized: String = session_id
.trim_matches(|c: char| c.is_whitespace() || c == '\u{feff}')
.to_lowercase()
.chars()
.map(|c| {
if c.is_ascii_lowercase() || c.is_ascii_digit() || c == '_' || c == '-' {
c
} else {
'-'
}
})
.collect();
if sanitized.is_empty() {
"default".to_owned()
} else {
sanitized
}
}
fn random_session_id() -> String {
format!("{:08x}", rand::random::<u32>())
}
fn skills_plugin(skills: SkillsOption) -> Option<Arc<dyn Plugin>> {
let sources = match skills {
SkillsOption::Plugin(plugin) => return Some(Arc::new(plugin)),
SkillsOption::Default if Path::new(DEFAULT_SKILLS_DIR).is_dir() => vec![DEFAULT_SKILLS_DIR.into()],
SkillsOption::Sources(sources) if !sources.is_empty() => sources,
_ => return None,
};
Some(Arc::new(AgentSkills::new(AgentSkillsConfig {
skills: sources,
..Default::default()
})))
}
fn builtin_plugin_name(name: BuiltinPluginName) -> &'static str {
match name {
BuiltinPluginName::Environment => ENVIRONMENT_PLUGIN_NAME,
}
}
fn select_builtin_plugins(
names: &[BuiltinPluginName],
existing: &[Arc<dyn Plugin>],
factory: &BuiltinToolFactory,
) -> Vec<Arc<dyn Plugin>> {
names
.iter()
.filter(|name| {
!existing
.iter()
.any(|plugin| plugin.name() == builtin_plugin_name(**name))
})
.map(|name| match name {
BuiltinPluginName::Environment => (factory.environment)(),
})
.collect()
}
fn named_tools(sources: &[ToolSource]) -> Vec<&Arc<dyn Tool>> {
sources
.iter()
.filter_map(|source| match source {
ToolSource::Tool(tool) => Some(tool),
_ => None,
})
.collect()
}
fn plugin_tools(plugins: &[Arc<dyn Plugin>]) -> Vec<ToolSource> {
plugins.iter().flat_map(|plugin| plugin.get_tools()).collect()
}
struct NamedSource<'a> {
label: &'static str,
builtin: bool,
tools: Vec<&'a Arc<dyn Tool>>,
}
fn check_name_collisions(sources: &[NamedSource<'_>]) -> strands::Result<()> {
let mut seen: Vec<(String, &'static str, bool)> = Vec::new();
for source in sources {
for tool in &source.tools {
let key = tool.name().replace('-', "_");
if let Some((_, label, builtin)) = seen.iter().find(|(known, ..)| *known == key) {
let place = if *label == source.label {
source.label.to_owned()
} else {
format!("{label} and {}", source.label)
};
let remedy = if source.builtin || *builtin {
"Rename the tool you passed, or drop the built-in via builtinTools / builtinPlugins."
} else {
"Rename one so each tool has a unique name."
};
return Err(strands::Error::other(format!(
"Tool name {} is registered more than once (from {place}). {remedy}",
crate::types::json_string(tool.name())
)));
}
seen.push((key, source.label, source.builtin));
}
}
Ok(())
}
pub(crate) fn resolve_background_tasks(
configured: Option<Toggle<BackgroundTasksConfig>>,
forced: &[String],
) -> Toggle<BackgroundTasksConfig> {
let policy = match configured {
Some(Toggle::Off) => return Toggle::Off,
Some(Toggle::On(config)) if config != BackgroundTasksConfig::default() => config,
_ => BackgroundTasksConfig {
agentic: Some(vec!["*".to_owned()]),
..Default::default()
},
};
let omit_forced = |selectors: Vec<String>| -> Vec<String> {
selectors
.into_iter()
.filter(|selector| selector == "*" || !forced.contains(selector))
.collect()
};
let explicit_always = policy.always.is_some();
let mut always = omit_forced(policy.always.clone().unwrap_or_default());
always.extend(forced.iter().cloned());
Toggle::On(BackgroundTasksConfig {
agentic: policy.agentic.clone().map(omit_forced),
always: (!always.is_empty() || explicit_always).then_some(always),
never: policy.never.clone().map(omit_forced),
..policy
})
}
#[cfg_attr(not(test), allow(dead_code, reason = "inspected by tests"))]
pub(crate) struct Assembly {
pub(crate) config: AgentConfig,
pub(crate) parent: Arc<ParentConfig>,
pub(crate) model_plan: Option<ModelPlan>,
pub(crate) known_tool_names: HashSet<String>,
}
pub async fn create_harness(options: HarnessAgentOptions) -> strands::Result<Agent> {
create_harness_boxed(options, Env::process()).await
}
pub(crate) fn create_harness_boxed(
options: HarnessAgentOptions,
env: Env,
) -> BoxFuture<'static, strands::Result<Agent>> {
Box::pin(async move {
let has_sandbox = options.sandbox.is_some();
let assembly = assemble(options, &env).await?;
let agent = Agent::new(assembly.config)?;
if has_sandbox {
drop_sandbox_tools(&agent, assembly.known_tool_names);
}
Ok(agent)
})
}
fn drop_sandbox_tools(agent: &Agent, known: HashSet<String>) {
let _cleanup = agent.add_hook(move |event: &mut InitializedEvent<'_>| {
let vended: Vec<String> = event
.agent()
.sandbox()
.get_tools()
.iter()
.map(|tool| tool.name().to_owned())
.filter(|name| !known.contains(name))
.collect();
for name in vended {
event.agent_mut().tool_registry_mut().remove(&name);
}
});
}
#[cfg(feature = "mcp")]
async fn with_mcp_servers(
mut tools: Vec<ToolSource>,
servers: Option<McpServersOption>,
) -> strands::Result<Vec<ToolSource>> {
tools.extend(load_mcp_servers(servers.map(McpServersOption::into_source)).await?);
Ok(tools)
}
#[cfg(not(feature = "mcp"))]
async fn with_mcp_servers(
tools: Vec<ToolSource>,
servers: Option<McpServersOption>,
) -> strands::Result<Vec<ToolSource>> {
if servers.is_some() {
return Err(strands::Error::other(
"mcp_servers needs the strands-harness feature \"mcp\"; enable it to connect MCP servers.",
));
}
Ok(tools)
}
#[cfg(feature = "mcp")]
async fn load_mcp_servers(servers: Option<strands::mcp::McpServersSource>) -> strands::Result<Vec<ToolSource>> {
use strands::mcp::{McpClient, McpClientOptions, McpLoadServersOptions};
let Some(servers) = servers else {
return Ok(Vec::new());
};
let defaults = McpClientOptions {
continue_on_error: true,
..Default::default()
};
let options = McpLoadServersOptions {
prefix_with_server_name: true,
};
let clients = McpClient::load_servers(servers, defaults, options).await?;
Ok(clients.into_iter().map(ToolSource::McpClient).collect())
}
type SessionParts = (SessionManager, Option<Arc<dyn Storage>>);
fn session_parts(session: Option<SessionOption>) -> strands::Result<Option<SessionParts>> {
let config = match session.unwrap_or(SessionOption::On(SessionConfig::default())) {
SessionOption::Off => return Ok(None),
SessionOption::Manager(manager) => return Ok(Some((manager, None))),
SessionOption::On(config) => config,
};
if config.id.as_deref().is_some_and(|id| id.trim().is_empty()) {
return Err(strands::Error::other("session.id must be a non-empty string."));
}
let dir = config.dir.unwrap_or_else(|| PathBuf::from(DEFAULT_SESSION_DIR));
let session_id = config.id.as_deref().map_or_else(random_session_id, sanitize_session_id);
let manager = SessionManager::new(SessionManagerConfig {
storage: Some(Arc::new(LocalFileStorage::new(&dir).namespace("")?)),
session_id: Some(session_id.clone()),
save_latest_on: Some(SaveLatestStrategy::Message),
..Default::default()
})?;
let archive: Arc<dyn Storage> = Arc::new(LocalFileStorage::new(dir.join(&session_id)));
Ok(Some((manager, Some(archive))))
}
pub(crate) async fn assemble(options: HarnessAgentOptions, env: &Env) -> strands::Result<Assembly> {
assemble_with(options, env, &BUILTIN_TOOL_FACTORY).await
}
#[allow(
clippy::too_many_lines,
reason = "one pass over the options, in the order they resolve"
)]
pub(crate) async fn assemble_with(
options: HarnessAgentOptions,
env: &Env,
factory: &BuiltinToolFactory,
) -> strands::Result<Assembly> {
let HarnessAgentOptions {
tools,
plugins: consumer_plugins,
model,
effort,
instructions,
mcp_servers,
builtin_tools,
background_tasks,
caching,
context_manager,
session,
skills,
memory,
builtin_plugins,
interventions,
aux_model,
messages,
system_prompt,
app_state,
model_state,
printer,
retry_strategy,
structured_output_schema,
name,
description,
id,
tool_executor,
sort_tools,
conversation_manager,
trace_attributes,
baggage_attributes,
sandbox,
storage,
session_manager,
memory_manager,
} = options;
setup_telemetry(env)?;
let resolved = resolve_builtin_tools(builtin_tools.as_ref());
let explicit_search = web_search_explicit(builtin_tools.as_ref());
let web_search = web_search_mode(resolved.web_search, explicit_search, model.as_ref())?;
let request = ModelRequest {
effort,
web_search: web_search == Some(WebSearchMode::Native),
caching: caching.unwrap_or(true),
caching_explicit: caching.is_some(),
};
let resolved_model = resolve_model(model.as_ref(), DEFAULT_MODEL, request, env)?;
let system_prompt = system_prompt.or_else(|| Some(build_system_prompt(instructions.as_deref(), &[]).into()));
let consumer = with_mcp_servers(tools, mcp_servers).await?;
let memory_instance = matches!(memory, Some(MemoryOption::Manager(_))) || memory_manager.is_some();
let mut forwarded = resolved.to_config();
if web_search.is_none() {
forwarded.web_search = Some(false.into());
} else if !explicit_search {
forwarded.web_search = None;
}
let parent = Arc::new(ParentConfig {
model,
effort,
context_manager: context_manager.clone(),
skills: skills.clone(),
memory: if memory_instance {
Some(MemoryOption::Off)
} else {
memory.clone()
},
tools: consumer.clone(),
builtin_tools: forwarded,
caching,
builtin_plugins: builtin_plugins.clone(),
plugins: consumer_plugins.clone(),
interventions: interventions.clone(),
background_tasks: background_tasks.clone(),
sandbox: sandbox.clone(),
});
let builtin = build_builtin_tools(&resolved, web_search, &parent, env, factory)?;
let mut plugins = consumer_plugins.clone();
let has_skills = plugins.iter().any(|plugin| plugin.name() == AGENT_SKILLS_NAME);
if let Some(plugin) = skills_plugin(skills.unwrap_or(SkillsOption::Default)).filter(|_| !has_skills) {
plugins.push(plugin);
}
let builtin_plugin_names = builtin_plugins.unwrap_or_else(|| DEFAULT_BUILTIN_PLUGINS.to_vec());
let selected_plugins = select_builtin_plugins(&builtin_plugin_names, &plugins, factory);
plugins.extend(selected_plugins);
let harness_plugins = &plugins[consumer_plugins.len()..];
let (session_manager, storage) = match session_manager {
Some(manager) => (Some(manager), storage),
None => match session_parts(session)? {
Some((manager, archive)) => (Some(manager), storage.or(archive)),
None => (None, storage),
},
};
let memory_manager = match memory_manager {
Some(source) => Some(source),
None => match memory.unwrap_or(MemoryOption::On(MemoryConfig::default())) {
MemoryOption::Off => None,
MemoryOption::Manager(manager) => Some(manager.into()),
MemoryOption::On(config) => Some(
resolve_memory(
ResolveMemoryOptions {
stores: config.stores,
model: parent.model.clone(),
dir: config.dir,
web_fetch_model: resolved.web_fetch_config().and_then(|config| config.model),
read_only: false,
},
env,
)?
.into(),
),
},
};
let memory_tools = match &memory_manager {
Some(MemoryManagerSource::Manager(manager)) => manager.get_tools(),
_ => Vec::new(),
};
let builtin_sources: Vec<ToolSource> = builtin.iter().map(|tool| ToolSource::Tool(Arc::clone(tool))).collect();
let harness_plugin_tools = plugin_tools(harness_plugins);
let consumer_plugin_tools = plugin_tools(&consumer_plugins);
let sources = [
NamedSource {
label: "a built-in tool",
builtin: true,
tools: named_tools(&builtin_sources),
},
NamedSource {
label: "tools",
builtin: false,
tools: named_tools(&consumer),
},
NamedSource {
label: "a built-in plugin",
builtin: true,
tools: named_tools(&harness_plugin_tools),
},
NamedSource {
label: "plugins",
builtin: false,
tools: named_tools(&consumer_plugin_tools),
},
NamedSource {
label: "memory",
builtin: true,
tools: named_tools(&memory_tools),
},
];
check_name_collisions(&sources)?;
let known_tool_names = sources
.iter()
.flat_map(|source| source.tools.iter().map(|tool| tool.name().to_owned()))
.collect();
let handlers: Vec<Arc<dyn InterventionHandler>> = resolve_interventions(interventions.as_ref(), None)?;
let forced: Vec<String> = builtin_sources
.iter()
.chain(consumer.iter())
.filter_map(|source| match source {
ToolSource::Tool(tool) if ALWAYS_BACKGROUND_TOOL_NAMES.contains(&tool.name()) => {
Some(tool.name().to_owned())
}
_ => None,
})
.collect();
let background_tasks = resolve_background_tasks(background_tasks, &forced);
let mut agent_tools = builtin_sources;
agent_tools.extend(consumer);
let config = AgentConfig {
tools: agent_tools,
plugins,
interventions: handlers,
model: Some(resolved_model.source),
aux_model,
messages,
system_prompt,
app_state,
model_state,
printer,
retry_strategy,
structured_output_schema,
name,
description,
id,
tool_executor,
sort_tools,
conversation_manager,
context_manager: Some(context_manager.unwrap_or(ContextManagerStrategy::Auto)),
background_tasks: Some(background_tasks),
trace_attributes,
baggage_attributes,
sandbox,
storage,
session_manager,
memory_manager,
};
Ok(Assembly {
config,
parent,
model_plan: resolved_model.plan,
known_tool_names,
})
}
#[cfg(test)]
mod tests;