diff --git a/codex-rs/core/src/tools/spec.rs b/codex-rs/core/src/tools/spec.rs index 1a2f16b5c..d1d758c15 100644 --- a/codex-rs/core/src/tools/spec.rs +++ b/codex-rs/core/src/tools/spec.rs @@ -49,6 +49,7 @@ use codex_protocol::protocol::SubAgentSource; use codex_tools::parse_mcp_tool; pub use codex_tools::parse_tool_input_schema; use codex_utils_absolute_path::AbsolutePathBuf; +use codex_utils_template::Template; use serde::Deserialize; use serde::Serialize; use serde_json::Value as JsonValue; @@ -56,16 +57,27 @@ use serde_json::json; use std::collections::BTreeMap; use std::collections::HashMap; use std::path::PathBuf; +use std::sync::LazyLock; pub type JsonSchema = codex_tools::JsonSchema; #[cfg(test)] pub(crate) use codex_tools::mcp_call_tool_result_output_schema; -const TOOL_SEARCH_DESCRIPTION_TEMPLATE: &str = +const TOOL_SEARCH_DESCRIPTION_TEMPLATE_SOURCE: &str = include_str!("../../templates/search_tool/tool_description.md"); -const TOOL_SUGGEST_DESCRIPTION_TEMPLATE: &str = +const TOOL_SEARCH_DESCRIPTION_TEMPLATE_KEY: &str = "app_descriptions"; +static TOOL_SEARCH_DESCRIPTION_TEMPLATE: LazyLock