fix(search): share web search count schema limit

Co-authored-by: openclaw-clawsweeper[bot] <280122609+openclaw-clawsweeper[bot]@users.noreply.github.com>
This commit is contained in:
clawsweeper[bot]
2026-04-30 22:42:51 -07:00
committed by GitHub
parent 3af8e17cc5
commit 2fd7c054ae
2 changed files with 15 additions and 2 deletions

View File

@@ -1,11 +1,24 @@
import { describe, expect, it } from "vitest";
import {
MAX_SEARCH_COUNT,
buildUnsupportedSearchFilterResponse,
isoToPerplexityDate,
normalizeToIsoDate,
normalizeFreshness,
} from "./web-search-provider-common.js";
import { mergeScopedSearchConfig } from "./web-search-provider-config.js";
import { createWebSearchTool } from "./web-search.js";
describe("web_search tool schema", () => {
it("advertises the shared runtime count limit", () => {
const tool = createWebSearchTool();
const parameters = tool?.parameters as
| { properties?: { count?: { maximum?: unknown } } }
| undefined;
expect(parameters?.properties?.count?.maximum).toBe(MAX_SEARCH_COUNT);
});
});
describe("web_search freshness normalization", () => {
it("accepts Brave shortcut values and maps for Perplexity", () => {

View File

@@ -4,7 +4,7 @@ import type { RuntimeWebSearchMetadata } from "../../secrets/runtime-web-tools.t
import { resolveWebSearchProviderId, runWebSearch } from "../../web-search/runtime.js";
import type { AnyAgentTool } from "./common.js";
import { asToolParamsRecord, jsonResult } from "./common.js";
import { SEARCH_CACHE } from "./web-search-provider-common.js";
import { MAX_SEARCH_COUNT, SEARCH_CACHE } from "./web-search-provider-common.js";
const WebSearchSchema = {
type: "object",
@@ -14,7 +14,7 @@ const WebSearchSchema = {
type: "number",
description: "Number of results to return.",
minimum: 1,
maximum: 20,
maximum: MAX_SEARCH_COUNT,
},
country: {
type: "string",