Commit 144b2ac
authored
claude: disable built-in WebSearch via permissions.deny (not the no-op disabledTools key) (#188)
claude: disable built-in WebSearch via permissions.deny, not the no-op disabledTools key
`ucode claude` tries to suppress Claude Code's built-in WebSearch tool by
writing `"disabledTools": ["WebSearch"]` into the settings overlay. WebSearch
declares Anthropic's hosted `web_search_20250305` server tool, which the
Databricks gateway rejects with a 400 — so ucode disables it and routes web
search through the `web_search` MCP server instead.
But `disabledTools` is not a Claude Code settings key. Claude Code silently
ignores unknown keys, so WebSearch stays advertised to the model: it calls
WebSearch, hits the gateway 400, and only then falls back to the MCP tool — a
wasted turn plus a 400 in the transcript on every web-search request. Confirmed
on a staging managed session: the key was present in the merged --settings, yet
native WebSearch was still called and 400'd.
Use the real mechanism instead: a bare `permissions.deny` entry. A bare tool
name in `deny` removes the tool from Claude's context entirely (unlike a scoped
rule such as `WebSearch(*)`, which leaves it advertised and only blocks matching
calls), so `web_search_20250305` is never advertised to the model nor sent to
the gateway. The `web_search` MCP replacement is unchanged.
Co-authored-by: Isaac1 parent 446a24a commit 144b2ac
2 files changed
Lines changed: 19 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
205 | | - | |
206 | | - | |
207 | | - | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
208 | 216 | | |
209 | | - | |
210 | | - | |
| 217 | + | |
| 218 | + | |
211 | 219 | | |
212 | 220 | | |
213 | 221 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
| 214 | + | |
| 215 | + | |
214 | 216 | | |
215 | | - | |
| 217 | + | |
216 | 218 | | |
217 | 219 | | |
218 | 220 | | |
219 | | - | |
| 221 | + | |
220 | 222 | | |
221 | 223 | | |
222 | 224 | | |
223 | | - | |
| 225 | + | |
224 | 226 | | |
225 | 227 | | |
226 | 228 | | |
227 | | - | |
| 229 | + | |
228 | 230 | | |
229 | 231 | | |
230 | 232 | | |
| |||
0 commit comments