claude: allow disabling web_search MCP via web_search_model: false#198
Open
stuagano wants to merge 1 commit into
Open
claude: allow disabling web_search MCP via web_search_model: false#198stuagano wants to merge 1 commit into
stuagano wants to merge 1 commit into
Conversation
…false codex_models discovery only confirms an endpoint speaks the Responses API wire protocol, not that it has real OpenAI backing for server-side tools. A self-hosted model served through Databricks' Open Responses API wrapper (e.g. gpt-oss) matches the wire-protocol filter but has no such backing, so web_search calls to it 400 with "No OpenAI Response API backing." When that's the only discovered endpoint, there was previously no way to opt out short of manually removing the MCP registration after every `ucode configure` run. - `_resolve_web_search_model` treats `web_search_model: False` as an explicit opt-out, short-circuiting before the codex_models fallback. - `write_tool_config` now unregisters any stale web_search MCP entry when no model resolves, instead of only ever adding one.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
_resolve_web_search_modelpicks the model backing theweb_searchMCP server by preferring an explicitweb_search_modeloverride, otherwise falling back tocodex_models[0](the first endpoint auto-discovered as Responses-API-shaped). That discovery only confirms an endpoint speaks theopenai/v1/responseswire protocol — it doesn't confirm the endpoint has real OpenAI backing to execute server-side tools likeweb_search.A self-hosted model served through Databricks' Open Responses API wrapper (e.g. a
gpt-oss-120bcustom serving endpoint) matches that wire-protocol filter but has no such backing. When it's the only discovered endpoint in a workspace,ucodesilently wires it up as theweb_searchMCP's backing model, and every search call 400s withNo OpenAI Response API backing. There was previously no way to opt out short of manually runningclaude mcp remove web_search -s userafter everyucode configure(which re-registers it on the next run)._resolve_web_search_modelnow treatsweb_search_model: Falseas an explicit opt-out, short-circuiting before thecodex_modelsfallback (existing string-override and no-override behavior is unchanged).write_tool_confignow calls_unregister_web_search_mcp()when no model resolves, so a stale registration (from a prior run, or from just having setweb_search_model: false) is actually cleaned up instead of only ever being added to.Test plan
uv run pytest tests/test_agent_claude.py -q— 69 passeduv run pytest -q(excluding e2e, which need a live workspace) — 863 passeduv run ruff check .— cleantest_explicit_false_disables_regardless_of_codex_models,test_explicit_false_beats_string_codex_model,test_explicit_false_unregisters_instead_of_registering; updatedtest_skips_registration_without_codex_modelfor the new unregister-on-no-model behavior.This pull request and its description were written by Isaac.