mirror of
https://github.com/openclaw/openclaw.git
synced 2026-10-03 01:29:56 +00:00
Related: #154420 ## What Problem This Solves Fixes Brave LLM-context searches returning more results than requested and reusing the same cached response for different result counts. ## User Impact The existing `count` and configured result limit now apply to LLM-context results as well as ordinary web results. Repeating a search with the same count still uses the cache; changing the count does not reuse an incompatible result set. No configuration, permission, or storage migration is required. ## Why This Change Was Made The Brave response owner now resolves the count once, includes it in LLM-context cache identity, and limits results before wrapping and caching them. It does not send a new parameter to Brave's LLM Context API. The existing web-mode regression also covers LLM-context count limits and cache separation, rather than maintaining a second copy of the fixture. ## Evidence Exercised the source-built Gateway's authenticated `/tools/invoke` endpoint and its registered `web_search` tool against a real loopback HTTP server configured through Brave's documented `webSearch.baseUrl` proxy option. The server returned three distinct results using the Brave response formats; no fetch, tool, or cache callback was mocked. | Same-query calls | Before | After | | --- | --- | --- | | Requested counts | 1, 1, 2, 2 | 1, 1, 2, 2 | | Delivered LLM-context result counts | 3, 3, 3, 3 | 1, 1, 2, 2 | | Upstream request or cache replay | request, cache, cache, cache | request, cache, request, cache | Twelve scenarios per completed run also checked ordinary web mode, changed country and query/date filters, ordered result contents, publication dates, untrusted-content wrapping, and agreement between model-facing content and structured results. The LLM-context HTTP requests contained no unsupported `count` parameter. Both Gateway process groups and all owned children/listeners settled. The expanded regression failed before the fix (`count: 3` instead of `1`), while its web-mode control passed. After the fix, 45 focused tests in the Brave provider and configuration-merge suites passed (1.36 seconds total runner time). Scoped type-aware lint, formatting, and both source-size ratchets passed. The runtime was rebuilt and the complete registered-tool scenario passed again. The prepared commit preserves the contributor's original commit and has the identical source tree as the tested candidate (`1562ad2816c297541bda5b62d61fe78dd5b4e5c2`, tree `4ddcbe94fc9fe806f317543675fc8d716457722c`). Limits: this is controlled Brave-compatible HTTP proof of OpenClaw's supported proxy path, not a live Brave account/service request. An earlier candidate attempt stopped before tool invocation because its build omitted external first-party plugin artifacts; those artifacts were rebuilt through their canonical owner before the successful run. No paid model or search request was made. Co-authored-by: Ayaan Zaidi <hi@obviy.us> |
||
|---|---|---|
| .. | ||
| assets | ||
| src | ||
| index.ts | ||
| openclaw.plugin.json | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
| web-search-contract-api.ts | ||
| web-search-provider.ts | ||
| web-search-shared.ts | ||
@openclaw/brave-plugin
Official Brave Search provider plugin for OpenClaw.
This plugin registers Brave as a web_search provider. It supports normal Brave web search and Brave LLM Context API mode.
Install
openclaw plugins install @openclaw/brave-plugin
Restart the Gateway after installing or updating the plugin.
Configure
Store a Brave Search API key in plugin config or expose BRAVE_API_KEY to the Gateway:
openclaw config set plugins.entries.brave.enabled true
openclaw config set tools.web.search.provider brave
Provider-specific options live under plugins.entries.brave.config.webSearch.*.
Docs
Full setup, config examples, search modes, and tool parameters:
Package
- Plugin id:
brave - Package:
@openclaw/brave-plugin - Minimum OpenClaw host:
2026.4.10