openclaw - 💡(How to fix) Fix web_search tool aborts immediately with xAI Responses API (2026.3.28) [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#58063Fetched 2026-04-08 01:54:18
View on GitHub
Comments
1
Participants
2
Timeline
2
Reactions
0
Timeline (top)
commented ×1cross-referenced ×1

Error Message

The web_search tool aborts immediately (no timeout, no error log) when configured with tools.web.search.provider: grok after updating to 2026.3.28.

RAW_BUFFERClick to expand / collapse

Bug Description

The web_search tool aborts immediately (no timeout, no error log) when configured with tools.web.search.provider: grok after updating to 2026.3.28.

Expected behavior: Grok web search returns AI-synthesized search results. Actual behavior: Tool returns This operation was aborted within milliseconds.

Environment

  • OpenClaw: 2026.3.28
  • macOS: Darwin 25.3.0 (arm64)
  • Node: v25.6.1
  • Gateway: local loopback mode

Configuration

Relevant config sections in openclaw.json:

  • tools.web.search.provider: "grok"
  • plugins.entries.xai.enabled: true with webSearch.apiKey set
  • env.XAI_API_KEY set (tried both plugin config and env var)

What was attempted

  1. Added XAI_API_KEY to env block in openclaw.json (gateway restarted)
  2. Confirmed xAI plugin is enabled and plugins.entries.xai.config.webSearch.apiKey is set
  3. Confirmed tools.web.search.provider is set to grok
  4. Gateway logs show: [xai-auth] bootstrap config fallback but no search-related errors

Additional context

  • ollama_web_search fallback works fine (rules out network connectivity)
  • The xAI API key is valid (confirmed working via plugin bootstrap logs)
  • Issue may be related to the xAI Responses API migration in 2026.3.25
  • web_search tool appears to use a different code path than the xAI plugin's own web search capability

extent analysis

Fix Plan

The fix involves updating the web_search tool to handle the xAI Responses API migration correctly.

Steps to Fix

  • Update the web_search tool to use the new xAI API endpoint:
// In web_search.js, update the API endpoint URL
const apiEndpoint = 'https://api.xai.io/v2/responses';
  • Modify the web_search tool to handle the new API response format:
// In web_search.js, update the response handling logic
const handleResponse = (response) => {
  const results = response.data.results;
  // Process the results as needed
};
  • Ensure the XAI_API_KEY is properly set and passed to the web_search tool:
// In openclaw.json, confirm the XAI_API_KEY is set
"env": {
  "XAI_API_KEY": "YOUR_API_KEY_HERE"
}
  • Restart the gateway to apply the changes.

Verification

To verify the fix, run the web_search tool with the grok provider and confirm that it returns AI-synthesized search results without aborting.

Extra Tips

  • Ensure the xai plugin is enabled and properly configured.
  • Check the gateway logs for any errors related to the web_search tool or xAI API.
  • If issues persist, try setting the XAI_API_KEY as an environment variable instead of in the openclaw.json file.

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…

Still need to ship something?

×6

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

Back to top recommendations

TRENDING