Allow model catalogs to override incremental tool notices (#52736)

## What changed

Add `model_messages.tools.incremental_tools` overrides for the update hint, tool and namespace removal headers, and namespace instruction update and clearing messages. Missing, null, or over-512-byte values fall back to bundled wording; empty strings omit static text while retaining runtime names and instructions.

Substitute `{name}` in namespace message templates and append runtime instructions verbatim. Wording changes alone do not trigger tool catalog updates.

## Testing

Extend unit tests and MCP request-history snapshots to cover custom wording, empty notices, tool removal and restoration, and namespace instruction changes and clearing without repeating unchanged tools or notices.

GitOrigin-RevId: 22dea0a6fb4cfcd646f5e65346424834c8b7d5a2
This commit is contained in:
Alex Kira
2026-10-10 01:14:28 +00:00
committed by copyberry
parent 4bad6d78e9
commit e4490eff65
11 changed files with 493 additions and 52 deletions
+1
View File
@@ -147,6 +147,7 @@ impl Session {
let specs = step_context.tool_router.model_visible_specs();
let definitions = codex_tools::create_tools_json_for_responses_lite(&specs)?;
world_state.add_section(TopLevelToolsState::new(
model_messages.incremental_tools(),
definitions,
Some(Arc::clone(&extension_metrics)),
)?);