mirror of
https://github.com/openai/codex.git
synced 2026-10-20 17:38:45 +00:00
Make MCP and Code Mode input schema budgets configurable (#47936)
## Why Fixed schema budgets can strip parameter descriptions from large MCP tools or render their Code Mode input types as `unknown`. Allow larger budgets to preserve that guidance. ## What changed - Add `mcp_servers.<name>.tool_input_schema_max_bytes` to configure the UTF-8 byte threshold for best-effort input schema compaction, retaining the 5,000-byte default. - Add `features.code_mode.tool_input_schema_max_bytes` for rendered input types. Use the largest of the 16,000-byte default, the Code Mode setting, and the ordinary MCP server's explicit setting. - Apply rendering budgets to prompt declarations and the runtime tool catalog, and avoid reusing cached declarations after the Code Mode budget changes. ## Testing Add coverage for UTF-8 compaction thresholds, budget precedence, configuration round trips, and preservation of parameter guidance in both the Code Mode prompt and `ALL_TOOLS`. GitOrigin-RevId: 0ef2823a614d4794e636f518b09c0b03a5239b45
This commit is contained in:
@@ -28,6 +28,7 @@ fn execute_request_preserves_tool_schemas_namespaces_and_limits() {
|
||||
description: "search the workspace".to_string(),
|
||||
kind: CodeModeToolKind::Freeform,
|
||||
input_schema: Some(json!({"type": "object"})),
|
||||
input_schema_max_bytes: None,
|
||||
output_schema: Some(json!({"type": "string"})),
|
||||
}],
|
||||
source: "text('hello')".to_string(),
|
||||
|
||||
Reference in New Issue
Block a user