Add tool namespace metadata configuration (#37389)

## What changed

- Add `features.tool_registry.include_tool_namespaces_info` to the TOML model,
  generated schema, and resolved runtime configuration. The setting defaults to
  `false` and controls whether per-turn request metadata includes the resolved
  tool namespace inventory.
- Preserve the resolved setting in session configuration locks.
- Cover top-level and profile-scoped strict configuration, deserialization,
  resolution, and lock-file persistence.

GitOrigin-RevId: 74124086c0d7de30094b411001f0ec0af490935d
This commit is contained in:
rka-oai authored and copyberry committed 2026-08-07 06:29:09 +00:00
1 parent 0bdce9f424
commit 4ee41929ea
7 files changed
+43 -6

No files matched your search

+12 -2
View File
@@ -574,11 +574,17 @@ disable_in_process_fallback = true
async fn load_config_resolves_tool_registry_config() -> std::io::Result<()> {
let codex_home = tempdir()?;
for (config_toml, error_on_tool_collisions) in [
("", false),
for (config_toml, error_on_tool_collisions, include_tool_namespaces_info) in [
("", false, false),
(
"[features.tool_registry]\nerror_on_tool_collisions = true\n",
true,
false,
),
(
"[features.tool_registry]\ninclude_tool_namespaces_info = true\n",
false,
true,
),
] {
let config_toml: ConfigToml =
@@ -594,6 +600,10 @@ async fn load_config_resolves_tool_registry_config() -> std::io::Result<()> {
config.tool_registry.error_on_tool_collisions,
error_on_tool_collisions
);
assert_eq!(
config.tool_registry.include_tool_namespaces_info,
include_tool_namespaces_info
);
assert!(!config.features.enabled(Feature::CodeMode));
}
+8
View File
@@ -1115,6 +1115,8 @@ pub struct Config {
pub struct ToolRegistryConfig {
/// Fail the turn when multiple tools share the same effective name.
pub error_on_tool_collisions: bool,
/// Include the resolved tool namespace inventory in per-turn request metadata.
pub include_tool_namespaces_info: bool,
}
const DEFAULT_CODE_MODE_EXEC_YIELD_TIME_MS: u64 = 30_000;
@@ -3717,6 +3719,12 @@ impl Config {
.and_then(|features| features.tool_registry.as_ref())
.and_then(|config| config.error_on_tool_collisions)
.unwrap_or_default(),
include_tool_namespaces_info: cfg
.features
.as_ref()
.and_then(|features| features.tool_registry.as_ref())
.and_then(|config| config.include_tool_namespaces_info)
.unwrap_or_default(),
};
let code_mode = resolve_code_mode_config(&cfg);
let multi_agent_v2 = resolve_multi_agent_v2_config(&cfg);