mirror of
https://github.com/openai/codex.git
synced 2026-11-13 14:46:14 +00:00
Remove the legacy code-mode tool metadata inventory (#37500)
## What changed - Stop adding `code_mode_tool_names` to Responses Lite turn metadata. - Keep `code_mode_tool_names` reserved so client metadata cannot reintroduce the removed, unbounded inventory. - Use the opt-in `tool_namespaces_info` metadata, including each function's `code_mode_name`, when authoritative tool details are requested. ## Testing - Update Responses Lite and code-mode tests to verify the opt-in namespace metadata and normalized code-mode names. GitOrigin-RevId: cbfb9af984de71c7cc175d0cd47ae799a5275309
This commit is contained in:
1 parent
6db53df37f
commit
8e4b10446e
8 files changed
+32
-112
No files matched your search
@@ -79,29 +79,6 @@ async fn websocket_model_switch_to_responses_lite_omits_top_level_tools() -> Res
|
||||
|
||||
assert_eq!(non_lite_turn["model"].as_str(), Some("gpt-5.2"));
|
||||
assert_eq!(lite_turn["model"].as_str(), Some("gpt-5.4"));
|
||||
let non_lite_turn_metadata: Value = serde_json::from_str(
|
||||
non_lite_turn["client_metadata"]["x-codex-turn-metadata"]
|
||||
.as_str()
|
||||
.expect("non-lite turn metadata"),
|
||||
)?;
|
||||
assert!(non_lite_turn_metadata.get("code_mode_tool_names").is_none());
|
||||
let lite_turn_metadata: Value = serde_json::from_str(
|
||||
lite_turn["client_metadata"]["x-codex-turn-metadata"]
|
||||
.as_str()
|
||||
.expect("Responses Lite turn metadata"),
|
||||
)?;
|
||||
assert_eq!(
|
||||
lite_turn_metadata["code_mode_tool_names"]["view_image"],
|
||||
serde_json::json!({
|
||||
"name": "view_image",
|
||||
"namespace": null,
|
||||
})
|
||||
);
|
||||
assert!(
|
||||
lite_turn["client_metadata"]
|
||||
.get("x-codex-code-mode-tool-names")
|
||||
.is_none()
|
||||
);
|
||||
assert!(
|
||||
non_lite_turn
|
||||
.get("tools")
|
||||
|
||||
@@ -4853,6 +4853,7 @@ async fn code_mode_uses_the_first_dynamic_tool_for_a_normalized_name() -> Result
|
||||
model_info.tool_mode = Some(ToolMode::CodeMode);
|
||||
})
|
||||
.with_config(|config| {
|
||||
config.tool_registry.turn_metadata_includes_tool_info = true;
|
||||
config
|
||||
.features
|
||||
.enable(Feature::CodeMode)
|
||||
@@ -5041,18 +5042,9 @@ text(JSON.stringify({
|
||||
.as_str()
|
||||
.expect("Responses Lite should contain serialized turn metadata"),
|
||||
)?;
|
||||
assert_eq!(
|
||||
metadata["code_mode_tool_names"]["foo_bar"],
|
||||
serde_json::json!({
|
||||
"name": "foo-bar",
|
||||
"namespace": null,
|
||||
}),
|
||||
);
|
||||
assert!(
|
||||
metadata["code_mode_tool_names"]
|
||||
.get("tool_search")
|
||||
.is_none()
|
||||
);
|
||||
let functions = &metadata["tool_namespaces_info"]["functions"]["functions"];
|
||||
assert_eq!(functions["foo-bar"]["code_mode_name"], "foo_bar");
|
||||
assert!(functions["foo_bar"]["code_mode_name"].is_null());
|
||||
}
|
||||
|
||||
let exec_description = model_tools
|
||||
|
||||
@@ -157,15 +157,7 @@ async fn responses_lite_uses_input_items_for_instructions_and_tools() -> Result<
|
||||
.context("Responses request should include turn metadata")?,
|
||||
)?;
|
||||
|
||||
assert_eq!(
|
||||
turn_metadata["code_mode_tool_names"]["view_image"],
|
||||
serde_json::json!({
|
||||
"name": "view_image",
|
||||
"namespace": null,
|
||||
})
|
||||
);
|
||||
assert!(turn_metadata.get("tool_namespaces_info").is_none());
|
||||
assert!(!client_metadata.contains_key("x-codex-code-mode-tool-names"));
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user