mirror of
https://github.com/openai/codex.git
synced 2026-11-21 22:50:37 +00:00
Fix dynamic namespace description precedence
This commit is contained in:
@@ -94,6 +94,11 @@ pub fn coalesce_loadable_tool_specs(
|
||||
LoadableToolSpec::Function(_) | LoadableToolSpec::Namespace(_) => None,
|
||||
})
|
||||
{
|
||||
if existing_namespace.description.trim().is_empty()
|
||||
&& !namespace.description.trim().is_empty()
|
||||
{
|
||||
existing_namespace.description = namespace.description;
|
||||
}
|
||||
existing_namespace.tools.append(&mut namespace.tools);
|
||||
} else {
|
||||
coalesced_specs.push(LoadableToolSpec::Namespace(namespace));
|
||||
@@ -101,6 +106,14 @@ pub fn coalesce_loadable_tool_specs(
|
||||
}
|
||||
}
|
||||
}
|
||||
for spec in &mut coalesced_specs {
|
||||
let LoadableToolSpec::Namespace(namespace) = spec else {
|
||||
continue;
|
||||
};
|
||||
if namespace.description.trim().is_empty() {
|
||||
namespace.description = default_namespace_description(&namespace.name);
|
||||
}
|
||||
}
|
||||
coalesced_specs
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user