mirror of
https://github.com/openai/codex.git
synced 2026-10-26 16:00:02 +00:00
Include code-mode tool names in Responses Lite metadata (#35271)
## What changed - Add `code_mode_tool_names` to Responses Lite turn metadata, mapping each normalized code-mode identifier to its structured `ToolName`. - Reserve the metadata key against client overrides and omit it from metadata exposed to external MCP servers. - Keep non-Lite requests and the legacy top-level client metadata unchanged. ## Testing - Cover HTTP and WebSocket Responses Lite requests, including switching from a non-Lite model. - Verify reserved-key handling and external MCP metadata filtering. GitOrigin-RevId: b678afba13d57a91e26f5895aa37238fbb4cb276
This commit is contained in:
@@ -493,6 +493,22 @@ fn build_code_mode_executors(
|
||||
code_mode_nested_tool_specs.push(spec);
|
||||
}
|
||||
|
||||
if turn_context.model_info.use_responses_lite {
|
||||
let code_mode_tool_names =
|
||||
collect_code_mode_exec_prompt_tool_definitions(code_mode_nested_tool_specs.iter())
|
||||
.into_iter()
|
||||
.map(|tool| {
|
||||
(
|
||||
codex_code_mode::normalize_code_mode_identifier(&tool.name),
|
||||
tool.tool_name,
|
||||
)
|
||||
})
|
||||
.collect();
|
||||
turn_context
|
||||
.turn_metadata_state
|
||||
.set_code_mode_tool_names(code_mode_tool_names);
|
||||
}
|
||||
|
||||
let namespace_descriptions = code_mode_namespace_descriptions(&exec_prompt_tool_specs);
|
||||
let mut enabled_tools =
|
||||
collect_code_mode_exec_prompt_tool_definitions(exec_prompt_tool_specs.iter());
|
||||
|
||||
Reference in New Issue
Block a user