openclaw - ✅(Solved) Fix [Bug]: web_search tool returns "provider unavailable" even when Brave plugin is loaded and API key is configured correctly [1 pull requests, 1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#77676Fetched 2026-05-06 06:23:09
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
2
Timeline (top)
labeled ×2commented ×1cross-referenced ×1

The web_search tool consistently returns the error web_search is disabled or no provider is available, despite the Brave Search plugin (@openclaw/brave-plugin) being successfully loaded by the Gateway (confirmed in startup logs) and the Brave API key being valid and functional (confirmed via direct curl testing). The configuration (tools.web.search.provider: "brave" and plugins.entries.brave.enabled: true) appears correct, yet the tool system fails to route requests to the loaded provider.

Error Message

Gateway startup (fresh restart) — confirms plugin is loaded: [INFO] http server listening (2 plugins: brave, feishu; 3.2s) [INFO] starting channels and sidecars... [INFO] starting feishu[default] (mode: websocket) [INFO] gateway ready

Tool invocation error: [ERROR] [tools] web_search failed: web_search is disabled or no provider is available. raw_params={"query":"OpenClaw AI assistant"}

Provider autodetect warning at the same time: [WARN] [WEB_SEARCH_PROVIDER_INVALID_AUTODETECT] tools.web.search.provider is "brave". Falling back to auto-detect precedence.

Direct curl test (bypassing OpenClaw — works perfectly): curl -s -x <PROXY_URL>
"https://api.search.brave.com/res/v1/web/search?q=OpenClaw&count=3"
-H "Accept: application/json"
-H "X-Subscription-Token: <BRAVE_API_KEY>"

Returns HTTP 200 with valid search results

Root Cause

The web_search tool consistently returns the error web_search is disabled or no provider is available, despite the Brave Search plugin (@openclaw/brave-plugin) being successfully loaded by the Gateway (confirmed in startup logs) and the Brave API key being valid and functional (confirmed via direct curl testing). The configuration (tools.web.search.provider: "brave" and plugins.entries.brave.enabled: true) appears correct, yet the tool system fails to route requests to the loaded provider.

Fix Action

Fixed

PR fix notes

PR #77777: fix(web_search): skip redundant provider re-resolution for external Brave plugin

Description (problem / solution / changelog)

Summary

  • Problem: When tools.web.search.provider: "brave" is explicitly configured and Brave is installed as an external (non-bundled) plugin via openclaw plugins install, the runtime emits a spurious WEB_SEARCH_PROVIDER_INVALID_AUTODETECT diagnostic at startup and records providerSource as "none" instead of "configured". Downstream code that gates behavior on providerSource === "configured" therefore sees the explicitly configured provider as absent.

  • Root Cause: resolveRuntimeWebProviderSurface in src/secrets/runtime-web-tools.shared.ts resolves the owning plugin for a configured provider via resolveManifestContractOwnerPluginId({origin: "bundled"}). For external plugins this lookup correctly returns undefined, so configuredBundledPluginId remains unset. A secondary resolution block then fires any time rawProvider is set and configuredBundledPluginId is still undefined — including the external-plugin case — and invokes resolveProviders a second time. That second call can race with an in-flight plugin registry load, returning an empty provider list. With an empty list the configured provider ID cannot be matched, configuredProvider becomes undefined, and the diagnostic is emitted. The secondary block was intended only for the case where a scoped-hint first pass had already missed the provider; it was not meant to fire when the first full-discovery pass had already found it.

  • Fix: Guard the secondary resolution block with an additional condition: only enter it when the configured provider was not found in the first resolveProviders result. This preserves the intended recovery behavior — if the first scoped pass missed the provider, the block still widens the scope and retries — while eliminating the redundant and potentially destructive invocation for the external-plugin case where the provider is already present.

  • What changed:

    • src/secrets/runtime-web-tools.shared.ts: added && !allProviders.some(provider => provider.id === params.rawProvider) to the secondary resolution block's guard in resolveRuntimeWebProviderSurface.
    • src/secrets/runtime-web-tools.test.ts: added a regression test that simulates the exact failure path — external Brave install records, resolveManifestContractOwnerPluginId returning undefined for origin: "bundled", the second discovery call returning an empty list — and asserts that selectedProvider is "brave", providerSource is "configured", no WEB_SEARCH_PROVIDER_INVALID_AUTODETECT warning is emitted, and provider discovery is invoked exactly once.
    • CHANGELOG.md: added entry under ## Unreleased.
  • What did NOT change (scope boundary):

    • The runWebSearch execution path is not affected by this change and is out of scope.
    • The origin: "bundled" lookup inside the secondary block is unchanged; when the block legitimately fires (first pass missed the provider) its behavior is identical to before.
    • No changes to plugin loading, the active-registry contract, or any other web-tool surface.

Reproduction

  1. Install Brave as an external plugin: openclaw plugins install @openclaw/brave-search
  2. Add to your OpenClaw config:
    tools:
      web:
        search:
          provider: brave
    plugins:
      entries:
        brave:
          config:
            webSearch:
              apiKey: "sk-brave-..."
  3. Start the gateway. A WEB_SEARCH_PROVIDER_INVALID_AUTODETECT warning appears in startup logs and providerSource reads as "none" despite the explicit provider configuration.

Risk / Mitigation

  • Risk: Low. The new guard is purely additive — it prevents the secondary resolveProviders call only when the first pass already returned the configured provider. All code paths that depend on the secondary block (scoped-hint recovery, where the first pass misses the provider) continue to enter it because the provider is absent from the first-pass result, making the new condition false.
  • Mitigation: The regression test directly exercises the failure mode by returning an empty list on the second discovery call; the test fails without the fix and passes with it. All existing tests are unmodified and continue to pass.

Change Type / Scope / Linked Issue

  • Type: Bug fix
  • Scope: src/secrets/runtime-web-tools.shared.ts, src/secrets/runtime-web-tools.test.ts, CHANGELOG.md
  • Linked issue: Fixes #77676

Changed files

  • CHANGELOG.md (modified, +1/-0)
  • src/secrets/runtime-web-tools.shared.ts (modified, +5/-1)
  • src/secrets/runtime-web-tools.test.ts (modified, +84/-0)

Code Example

Gateway startup (fresh restart) — confirms plugin is loaded:
[INFO] http server listening (2 plugins: brave, feishu; 3.2s)
[INFO] starting channels and sidecars...
[INFO] starting feishu[default] (mode: websocket)
[INFO] gateway ready

Tool invocation error:
[ERROR] [tools] web_search failed: web_search is disabled or no provider is available. raw_params={"query":"OpenClaw AI assistant"}

Provider autodetect warning at the same time:
[WARN] [WEB_SEARCH_PROVIDER_INVALID_AUTODETECT] tools.web.search.provider is "brave". Falling back to auto-detect precedence.

Direct curl test (bypassing OpenClaw — works perfectly):
curl -s -x <PROXY_URL> \
  "https://api.search.brave.com/res/v1/web/search?q=OpenClaw&count=3" \
  -H "Accept: application/json" \
  -H "X-Subscription-Token: <BRAVE_API_KEY>"
# Returns HTTP 200 with valid search results
RAW_BUFFERClick to expand / collapse

Bug type

Regression (worked before, now fails)

Beta release blocker

No

Summary

The web_search tool consistently returns the error web_search is disabled or no provider is available, despite the Brave Search plugin (@openclaw/brave-plugin) being successfully loaded by the Gateway (confirmed in startup logs) and the Brave API key being valid and functional (confirmed via direct curl testing). The configuration (tools.web.search.provider: "brave" and plugins.entries.brave.enabled: true) appears correct, yet the tool system fails to route requests to the loaded provider.

Steps to reproduce

  1. Install and enable the @openclaw/brave-plugin (e.g., via openclaw plugins enable brave).
  2. Configure a Brave Search API key at plugins.entries.brave.config.webSearch.apiKey.
  3. Set tools.web.search.provider to "brave" and tools.web.search.enabled to true in the OpenClaw config.
  4. Ensure the Gateway is running (openclaw gateway start or via LaunchAgent).
  5. Attempt to invoke the web_search tool (e.g., via the Web UI or an agent session that calls the tool).
  6. Observe that the tool returns: {"status": "error", "error": "web_search is disabled or no provider is available."}

Expected behavior

The web_search tool should successfully call the Brave Search API and return search results. The Gateway startup logs should confirm the Brave web-search provider is registered and active, and the tool should function without returning a "provider unavailable" error.

Actual behavior

  • The Gateway starts and logs show http server listening (2 plugins: brave, feishu; X.Xs), confirming the Brave plugin is loaded.
  • Direct curl calls to https://api.search.brave.com/res/v1/web/search with the configured API key return HTTP 200 and valid search results.
  • However, the web_search tool always returns: {"status": "error", "error": "web_search is disabled or no provider is available."}
  • The following warning appears in logs at tool invocation time: [WEB_SEARCH_PROVIDER_INVALID_AUTODETECT] tools.web.search.provider is "brave". Falling back to auto-detect precedence. This indicates the system cannot recognize "brave" as a valid web search provider, even though the plugin is loaded.

OpenClaw version

OpenClaw 2026.5.3 (06d46f7)

Operating system

ProductName: macOS ProductVersion: 26.4.1 (arm64)

Install method

No response

Model

minimax-portal/MiniMax-M2.7

Provider / routing chain

web_search tool → tools.web.search.provider: "brave" → plugins.entries.brave.enabled: true → @openclaw/[email protected] (loaded) → Brave Search API (https://api.search.brave.com/res/v1/web/search) → API key: configured and verified valid → Proxy: user-configured local proxy

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Gateway startup (fresh restart) — confirms plugin is loaded:
[INFO] http server listening (2 plugins: brave, feishu; 3.2s)
[INFO] starting channels and sidecars...
[INFO] starting feishu[default] (mode: websocket)
[INFO] gateway ready

Tool invocation error:
[ERROR] [tools] web_search failed: web_search is disabled or no provider is available. raw_params={"query":"OpenClaw AI assistant"}

Provider autodetect warning at the same time:
[WARN] [WEB_SEARCH_PROVIDER_INVALID_AUTODETECT] tools.web.search.provider is "brave". Falling back to auto-detect precedence.

Direct curl test (bypassing OpenClaw — works perfectly):
curl -s -x <PROXY_URL> \
  "https://api.search.brave.com/res/v1/web/search?q=OpenClaw&count=3" \
  -H "Accept: application/json" \
  -H "X-Subscription-Token: <BRAVE_API_KEY>"
# Returns HTTP 200 with valid search results

Impact and severity

No response

Additional information

  • Gateway config (tools section): "tools": { "profile": "coding", "web": { "search": { "enabled": true, "provider": "brave" }, "fetch": { "enabled": true } } }

  • Gateway config (plugins section): "plugins": { "entries": { "brave": { "enabled": true, "config": { "webSearch": { "apiKey": "***" } } } }, "allow": ["feishu", "brave", "minimax"] }

  • Troubleshooting attempts: ✅ Confirmed the Brave API key is valid and returns 200 via direct curl (bypassing OpenClaw entirely). ✅ Confirmed plugins.entries.brave.enabled: true in config. ✅ Confirmed tools.web.search.provider: "brave" and tools.web.search.enabled: true. ✅ Confirmed openclaw plugins list shows brave as enabled. ✅ Confirmed Gateway startup log shows (2 plugins: brave, feishu) after enabling onStartup in openclaw.plugin.json. ⚠️ The plugin is loaded but the tool system still cannot find the provider — the WEB_SEARCH_PROVIDER_INVALID_AUTODETECT warning suggests the plugin's provider registration is not propagating to the tool routing layer. Key observation: The WEB_SEARCH_PROVIDER_INVALID_AUTODETECT warning fires after the plugin is loaded, suggesting the issue may be a race condition, a missing registration call in the plugin lifecycle, or a config path mismatch between where the plugin stores its provider ID and where the tool system looks for it.

extent analysis

TL;DR

The issue is likely due to a configuration or registration mismatch between the Brave plugin and the OpenClaw tool system, causing the tool to fail to recognize the Brave provider.

Guidance

  • Verify that the tools.web.search.provider configuration is correctly set to "brave" and that the plugins.entries.brave.enabled is set to true in the OpenClaw config.
  • Check the OpenClaw logs for any errors or warnings related to plugin loading or registration, specifically the WEB_SEARCH_PROVIDER_INVALID_AUTODETECT warning.
  • Investigate the possibility of a race condition or missing registration call in the plugin lifecycle, ensuring that the Brave plugin is properly registered with the OpenClaw tool system.
  • Review the plugin's configuration and registration code to ensure that it matches the expected format and location for the OpenClaw tool system.

Example

No code example is provided as the issue seems to be related to configuration and plugin registration rather than a specific code snippet.

Notes

The issue may be specific to the OpenClaw version (2026.5.3) or the Brave plugin version, and further investigation may be required to determine the root cause.

Recommendation

Apply a workaround by verifying the plugin registration and configuration, and if necessary, modify the plugin code to ensure proper registration with the OpenClaw tool system. This is recommended as the issue seems to be related to a configuration or registration mismatch rather than a version-specific bug.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

The web_search tool should successfully call the Brave Search API and return search results. The Gateway startup logs should confirm the Brave web-search provider is registered and active, and the tool should function without returning a "provider unavailable" error.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - ✅(Solved) Fix [Bug]: web_search tool returns "provider unavailable" even when Brave plugin is loaded and API key is configured correctly [1 pull requests, 1 comments, 2 participants]