Canonicalize default tools under the functions namespace (#37022)

## What changed

- Group top-level function and custom tool definitions into a single `functions` namespace for Responses Lite providers that support namespaced tools.
- Normalize missing, empty, and explicit `functions` namespaces to the same tool identity across registration, routing, lifecycle hooks, configuration, and tool search.
- Keep default tool names unprefixed in code mode, display output, and dispatch traces while preserving explicit non-default namespaces.

## Testing

- Add coverage for Responses Lite serialization, tool search results, namespace normalization and collision handling, routing, lifecycle events, and code-mode namespace policies.

GitOrigin-RevId: d48414005b5d22d39b11a198e19c47814d3a19f2
This commit is contained in:
rka-oai authored and copyberry committed 2026-08-05 04:07:59 +00:00
1 parent 1e489adad0
commit f21dc46388
29 files changed
+522 -78

No files matched your search

+2 -2
View File
@@ -161,7 +161,7 @@ impl ToolRouter {
call_id,
..
} => {
let tool_name = ToolName::new(namespace, name);
let tool_name = ToolName::new(namespace, name).with_default_namespace();
Ok(Some(ToolCall {
tool_name,
call_id,
@@ -196,7 +196,7 @@ impl ToolRouter {
call_id,
..
} => Ok(Some(ToolCall {
tool_name: ToolName::new(namespace, name),
tool_name: ToolName::new(namespace, name).with_default_namespace(),
call_id,
payload: ToolPayload::Custom { input },
encrypted_function_args: None,