From f0e15b916ff0aa56f25d0b8a9e519a39c297b9f1 Mon Sep 17 00:00:00 2001 From: sayan-oai Date: Mon, 1 Jun 2026 14:01:30 -0700 Subject: [PATCH] [codex] Generalize deferred nested tool guidance (#25689) ## Summary - describe omitted code-mode tools as deferred nested tools instead of MCP/app tools - update the prompt-description assertion to match ## Why Deferred dynamic tools are also callable through `tools` and discoverable in `ALL_TOOLS`, so the previous MCP/app-specific wording was too narrow. ## Validation - `just fmt` - `just test -p codex-code-mode` - `git diff --check` --- codex-rs/code-mode/src/description.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/codex-rs/code-mode/src/description.rs b/codex-rs/code-mode/src/description.rs index ca606cc10..50fcc034b 100644 --- a/codex-rs/code-mode/src/description.rs +++ b/codex-rs/code-mode/src/description.rs @@ -7,7 +7,7 @@ use std::collections::BTreeMap; use crate::PUBLIC_TOOL_NAME; const MAX_JS_SAFE_INTEGER: u64 = (1_u64 << 53) - 1; -const DEFERRED_NESTED_TOOLS_GUIDANCE: &str = r#"Some nested MCP/app tools may be omitted from this description. They are still available on the global `tools` object and listed in `ALL_TOOLS`. +const DEFERRED_NESTED_TOOLS_GUIDANCE: &str = r#"Some deferred nested tools may be omitted from this description. They are still available on the global `tools` object and listed in `ALL_TOOLS`. To find one, filter `ALL_TOOLS` by `name` and `description`."#; const EXEC_DESCRIPTION_TEMPLATE: &str = r#"Run JavaScript code to orchestrate/compose tool calls - Evaluates the provided JavaScript code in a fresh V8 isolate as an async module. @@ -1091,7 +1091,7 @@ bar" /*deferred_tools_available*/ true, ); - assert!(description.contains("Some nested MCP/app tools may be omitted")); + assert!(description.contains("Some deferred nested tools may be omitted")); assert!(description.contains("filter `ALL_TOOLS` by `name` and `description`")); assert!(!description.contains("do not print the full `ALL_TOOLS` array")); }