mirror of
https://github.com/openai/codex.git
synced 2026-11-05 20:10:33 +00:00
Always put Code Mode tool descriptions before namespace descriptions (#57462)
## What changed Make tool descriptions precede namespace descriptions in Code Mode execution and tool search. Mark `code_mode_tool_description_first` as removed and simplify cached definitions to depend only on the input schema budget. ## Testing Update Code Mode integration assertions and catalog snapshots to expect tool descriptions before namespace descriptions. GitOrigin-RevId: 1344d4c264d1d2b18ee0388a064b6813ca81f770
This commit is contained in:
@@ -90,7 +90,6 @@ pub fn tool_spec_to_code_mode_tool_definition(spec: &ToolSpec) -> Option<CodeMod
|
||||
pub fn collect_code_mode_tool_definitions<'a>(
|
||||
specs: impl IntoIterator<Item = &'a ToolSpec>,
|
||||
code_mode_input_schema_max_bytes: Option<usize>,
|
||||
tool_description_first: bool,
|
||||
) -> Vec<CodeModeToolDefinition> {
|
||||
let mut tool_definitions = specs
|
||||
.into_iter()
|
||||
@@ -101,11 +100,8 @@ pub fn collect_code_mode_tool_definitions<'a>(
|
||||
let namespace_description = namespace.description.trim();
|
||||
if !namespace_description.is_empty() {
|
||||
for definition in &mut definitions {
|
||||
definition.description = if tool_description_first {
|
||||
format!("{}\n\n{namespace_description}", definition.description)
|
||||
} else {
|
||||
format!("{namespace_description}\n\n{}", definition.description)
|
||||
};
|
||||
definition.description =
|
||||
format!("{}\n\n{namespace_description}", definition.description);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user