mirror of
https://github.com/openai/codex.git
synced 2026-04-30 19:32:04 +03:00
Normalize MCP tool names to code-mode safe form (#14605)
Code mode doesn't allow `-` in names and it's better if function names and code-mode names are the same.
This commit is contained in:
@@ -307,7 +307,7 @@ async fn explicit_plugin_mentions_inject_plugin_guidance() -> Result<()> {
|
||||
assert!(
|
||||
request_tools
|
||||
.iter()
|
||||
.any(|name| name == "mcp__codex_apps__google-calendar-create-event"),
|
||||
.any(|name| name == "mcp__codex_apps__google_calendar_create_event"),
|
||||
"expected plugin app tools to become visible for this turn: {request_tools:?}"
|
||||
);
|
||||
let echo_description = tool_description(&request_body, "mcp__sample__echo")
|
||||
@@ -318,7 +318,7 @@ async fn explicit_plugin_mentions_inject_plugin_guidance() -> Result<()> {
|
||||
);
|
||||
let calendar_description = tool_description(
|
||||
&request_body,
|
||||
"mcp__codex_apps__google-calendar-create-event",
|
||||
"mcp__codex_apps__google_calendar_create_event",
|
||||
)
|
||||
.expect("plugin app tool description should be present");
|
||||
assert!(
|
||||
|
||||
@@ -34,10 +34,10 @@ const SEARCH_TOOL_DESCRIPTION_SNIPPETS: [&str; 1] = [
|
||||
"Tools of the apps (Calendar) are hidden until you search for them with this tool (`tool_search`).",
|
||||
];
|
||||
const TOOL_SEARCH_TOOL_NAME: &str = "tool_search";
|
||||
const CALENDAR_CREATE_TOOL: &str = "mcp__codex_apps__calendar-create-event";
|
||||
const CALENDAR_LIST_TOOL: &str = "mcp__codex_apps__calendar-list-events";
|
||||
const CALENDAR_CREATE_TOOL: &str = "mcp__codex_apps__calendar_create_event";
|
||||
const CALENDAR_LIST_TOOL: &str = "mcp__codex_apps__calendar_list_events";
|
||||
const SEARCH_CALENDAR_NAMESPACE: &str = "mcp__codex_apps__calendar";
|
||||
const SEARCH_CALENDAR_CREATE_TOOL: &str = "-create-event";
|
||||
const SEARCH_CALENDAR_CREATE_TOOL: &str = "_create_event";
|
||||
|
||||
fn tool_names(body: &Value) -> Vec<String> {
|
||||
body.get("tools")
|
||||
|
||||
Reference in New Issue
Block a user