fix: require web search query schema · openclaw/openclaw@e360e10
steipete
·
2026-05-15
·
via Recent Commits to openclaw:main
File tree
test/fixtures/agents/prompt-snapshots/codex-runtime-happy-path
| Original file line number | Diff line number | Diff line change |
|---|
@@ -158,6 +158,7 @@ Docs: https://docs.openclaw.ai
|
158 | 158 | - Memory host SDK: report malformed remote JSON with caller-scoped errors for POST and batch file upload responses instead of leaking raw parser failures. |
159 | 159 | - Media providers: report malformed operation-poll and audio-transcription JSON with provider-owned errors instead of leaking raw parser failures. |
160 | 160 | - MiniMax, Gemini, Kimi, and Ollama web search: report malformed API JSON with provider-owned errors instead of leaking raw parser failures. |
| 161 | +- Web search: mark the managed `web_search` `query` argument as required in the advertised tool schema, so schema-following local models stop emitting `queries` payloads that fail at execution. Fixes #82097. Thanks @SpidFightFR. |
161 | 162 | - Twilio voice-call: report malformed successful API JSON responses with provider-owned errors instead of leaking raw parser failures. |
162 | 163 | - Voice-call provider APIs: report malformed successful guarded JSON responses with provider-prefixed errors instead of leaking raw parser failures. |
163 | 164 | - Realtime transcription: report malformed provider websocket JSON frames with owned parser errors instead of leaking raw `SyntaxError` objects. |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -10,6 +10,13 @@ import { mergeScopedSearchConfig } from "./web-search-provider-config.js";
|
10 | 10 | import { createWebSearchTool } from "./web-search.js"; |
11 | 11 | |
12 | 12 | describe("web_search tool schema", () => { |
| 13 | +it("marks query as required for model tool-call schemas", () => { |
| 14 | +const tool = createWebSearchTool(); |
| 15 | +const parameters = tool?.parameters as { required?: unknown } | undefined; |
| 16 | + |
| 17 | +expect(parameters?.required).toEqual(["query"]); |
| 18 | +}); |
| 19 | + |
13 | 20 | it("advertises the shared runtime count limit", () => { |
14 | 21 | const tool = createWebSearchTool(); |
15 | 22 | const parameters = tool?.parameters as |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -8,6 +8,7 @@ import { resolveWebSearchToolRuntimeContext } from "./web-tool-runtime-context.j
|
8 | 8 | |
9 | 9 | const WebSearchSchema = { |
10 | 10 | type: "object", |
| 11 | +required: ["query"], |
11 | 12 | properties: { |
12 | 13 | query: { type: "string", description: "Search query string." }, |
13 | 14 | count: { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -1174,6 +1174,7 @@
|
1174 | 1174 | "type": "string" |
1175 | 1175 | } |
1176 | 1176 | }, |
| 1177 | +"required": ["query"], |
1177 | 1178 | "type": "object" |
1178 | 1179 | }, |
1179 | 1180 | "name": "web_search", |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -1206,6 +1206,7 @@
|
1206 | 1206 | "type": "string" |
1207 | 1207 | } |
1208 | 1208 | }, |
| 1209 | +"required": ["query"], |
1209 | 1210 | "type": "object" |
1210 | 1211 | }, |
1211 | 1212 | "name": "web_search", |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -1170,6 +1170,7 @@
|
1170 | 1170 | "type": "string" |
1171 | 1171 | } |
1172 | 1172 | }, |
| 1173 | +"required": ["query"], |
1173 | 1174 | "type": "object" |
1174 | 1175 | }, |
1175 | 1176 | "name": "web_search", |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -217,8 +217,8 @@ This is the deterministic model-bound layer stack OpenClaw can snapshot for the
|
217 | 217 | "roughTokens": 140 |
218 | 218 | }, |
219 | 219 | "dynamicToolsJson": { |
220 | | -"chars": 44328, |
221 | | -"roughTokens": 11082 |
| 220 | +"chars": 44373, |
| 221 | +"roughTokens": 11094 |
222 | 222 | }, |
223 | 223 | "openClawDeveloperInstructions": { |
224 | 224 | "chars": 5436, |
@@ -229,8 +229,8 @@ This is the deterministic model-bound layer stack OpenClaw can snapshot for the
|
229 | 229 | "roughTokens": 7129 |
230 | 230 | }, |
231 | 231 | "totalWithDynamicToolsJson": { |
232 | | -"chars": 72846, |
233 | | -"roughTokens": 18212 |
| 232 | +"chars": 72891, |
| 233 | +"roughTokens": 18223 |
234 | 234 | }, |
235 | 235 | "userInputText": { |
236 | 236 | "chars": 870, |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -217,8 +217,8 @@ This is the deterministic model-bound layer stack OpenClaw can snapshot for the
|
217 | 217 | "roughTokens": 140 |
218 | 218 | }, |
219 | 219 | "dynamicToolsJson": { |
220 | | -"chars": 44019, |
221 | | -"roughTokens": 11005 |
| 220 | +"chars": 44064, |
| 221 | +"roughTokens": 11016 |
222 | 222 | }, |
223 | 223 | "openClawDeveloperInstructions": { |
224 | 224 | "chars": 4412, |
@@ -229,8 +229,8 @@ This is the deterministic model-bound layer stack OpenClaw can snapshot for the
|
229 | 229 | "roughTokens": 6748 |
230 | 230 | }, |
231 | 231 | "totalWithDynamicToolsJson": { |
232 | | -"chars": 71013, |
233 | | -"roughTokens": 17754 |
| 232 | +"chars": 71058, |
| 233 | +"roughTokens": 17765 |
234 | 234 | }, |
235 | 235 | "userInputText": { |
236 | 236 | "chars": 370, |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -218,8 +218,8 @@ This is the deterministic model-bound layer stack OpenClaw can snapshot for the
|
218 | 218 | "roughTokens": 140 |
219 | 219 | }, |
220 | 220 | "dynamicToolsJson": { |
221 | | -"chars": 45197, |
222 | | -"roughTokens": 11300 |
| 221 | +"chars": 45242, |
| 222 | +"roughTokens": 11311 |
223 | 223 | }, |
224 | 224 | "openClawDeveloperInstructions": { |
225 | 225 | "chars": 4412, |
@@ -230,8 +230,8 @@ This is the deterministic model-bound layer stack OpenClaw can snapshot for the
|
230 | 230 | "roughTokens": 7155 |
231 | 231 | }, |
232 | 232 | "totalWithDynamicToolsJson": { |
233 | | -"chars": 73818, |
234 | | -"roughTokens": 18455 |
| 233 | +"chars": 73863, |
| 234 | +"roughTokens": 18466 |
235 | 235 | }, |
236 | 236 | "userInputText": { |
237 | 237 | "chars": 608, |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。