fix(tavily): keep web_search contract executable#91110
Conversation
|
Codex review: needs maintainer review before merge. Reviewed June 13, 2026, 7:34 PM ET / 23:34 UTC. Summary PR surface: Source +31, Tests +29. Total +60 across 4 files. Reproducibility: yes. Source inspection shows current main and v2026.6.6 return Review metrics: none identified. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Next step before merge
Security Review detailsBest possible solution: Land this narrow contract/runtime alignment, keep Tavily startup activation metadata unchanged, and let #91096 close after merge. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection shows current main and v2026.6.6 return Is this the best way to solve the issue? Yes. The latest branch fixes the owner-local Tavily contract artifact by lazily delegating execution to the existing runtime provider, which is narrower and safer than the companion manifest startup change or a core resolver behavior change for this bug. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 47759c35063c. Label changesLabel justifications:
Evidence reviewedPR surface: Source +31, Tests +29. Total +60 across 4 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
d8733f4 to
839fe14
Compare
839fe14 to
c042500
Compare
c042500 to
b87ce3f
Compare
b87ce3f to
6190b56
Compare
|
Maintainer verification for current head
Merging by squash. |
Fixes #91096.
Summary
web-search-contract-apithrough the executable Tavily web search provider instead of returning a metadata-only provider.web_searchtool definition.Why
The Tavily manifest advertises
contracts.webSearchProviders: ["tavily"], and the plugin entrypoint registers a working provider. Some bundled web-search resolution paths can loadweb-search-contract-api.jsdirectly, though. Tavily's contract facade previously returnedcreateTool: () => null, so an explicittools.web.search.provider: tavilyconfiguration could resolve a provider descriptor but still have no executable provider available.Verification
pnpm installafter the first test run found missing local dependencies.node scripts/run-vitest.mjs extensions/tavily/src/tavily-tools.test.tsnode scripts/run-vitest.mjs src/plugins/web-provider-public-artifacts.explicit-fast-path.test.tspnpm exec oxfmt --write extensions/tavily/web-search-contract-api.ts extensions/tavily/src/tavily-tools.test.tsReal behavior proof
Behavior addressed: Tavily's bundled web-search contract facade now creates an executable
web_searchprovider instead of a metadata-only provider.Real environment tested: Local OpenClaw checkout on macOS, branch
fix/tavily-web-search-registration.Exact steps or command run after this patch:
pnpm exec tsx -e 'import { runWebSearch } from "./src/web-search/runtime.ts"; async function main() { try { await runWebSearch({ config: { plugins: { entries: { tavily: { enabled: true } } }, tools: { web: { search: { enabled: true, provider: "tavily" } } } }, preferInputConfig: true, preferRuntimeProviders: false, args: { query: "OpenClaw Tavily registration", count: 1 } }); console.log("unexpected success"); process.exit(1); } catch (error) { const message = error instanceof Error ? error.message : String(error); console.log(JSON.stringify({ providerReached: message.startsWith("web_search (tavily) needs a Tavily API key"), message }, null, 2)); if (!message.startsWith("web_search (tavily) needs a Tavily API key")) { process.exit(1); } } } main();'Evidence after fix: The runtime probe loaded OpenClaw's
runWebSearchwithtools.web.search.provider: "tavily"and no Tavily API key. It reached Tavily's provider-specific missing-key message instead ofweb_search is disabled or no provider is available.Terminal output:{ "providerReached": true, "message": "web_search (tavily) needs a Tavily API key. Set TAVILY_API_KEY in the Gateway environment, or configure plugins.entries.tavily.config.webSearch.apiKey." }Observed result after fix: The command exited 0 with
providerReached: true, proving the managedweb_searchpath found Tavily's executable provider and dispatched into it.What was not tested: A live Tavily API call was not run because this registration bug can be proven without a real API key.