Add tool registry collision policy configuration (#36954)

## What changed

- Add `features.tool_registry.error_on_tool_collisions`, defaulting to `false`, to the TOML model, generated schema, and resolved runtime configuration.
- Treat `tool_registry` as structured configuration rather than a feature toggle, including in strict config validation and profile configuration.
- Preserve the resolved collision policy in session config lockfiles when it is enabled or explicitly configured.

## Testing

- Cover deserialization, strict validation, default and enabled resolution, feature materialization, and config lockfile serialization.

GitOrigin-RevId: 2c27109dcf2a3d1e51064cc60088703e36a0f85a
This commit is contained in:
rka-oai authored and copyberry committed 2026-08-04 19:28:37 +00:00
1 parent b87981a510
commit 9952933c1d
11 files changed
+151 -6

No files matched your search

+30
View File
@@ -568,6 +568,36 @@ disable_in_process_fallback = true
Ok(())
}
#[tokio::test]
async fn load_config_resolves_tool_registry_config() -> std::io::Result<()> {
let codex_home = tempdir()?;
for (config_toml, error_on_tool_collisions) in [
("", false),
(
"[features.tool_registry]\nerror_on_tool_collisions = true\n",
true,
),
] {
let config_toml: ConfigToml =
toml::from_str(config_toml).expect("TOML deserialization should succeed");
let config = Config::load_from_base_config_with_overrides(
config_toml,
ConfigOverrides::default(),
codex_home.abs(),
)
.await?;
assert_eq!(
config.tool_registry.error_on_tool_collisions,
error_on_tool_collisions
);
assert!(!config.features.enabled(Feature::CodeMode));
}
Ok(())
}
#[tokio::test]
async fn load_config_resolves_token_budget_config() -> std::io::Result<()> {
for (config_toml, expected) in [