openclaw - ✅(Solved) Fix [Bug]: web_search tool fails — hardcoded api.grok.x.ai doesn't resolve (should be api.x.ai) [2 pull requests, 1 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#61377Fetched 2026-04-08 02:59:17
View on GitHub
Comments
0
Participants
1
Timeline
15
Reactions
0
Participants
Timeline (top)
referenced ×10cross-referenced ×2labeled ×2closed ×1

The web_search tool fails when configured Grok. It silently aborts every request because the configured xAI Grok API endpoint in Openclaw (api.grok.x.ai) does not resolve in public DNS.

Root Cause

The web_search tool fails when configured Grok. It silently aborts every request because the configured xAI Grok API endpoint in Openclaw (api.grok.x.ai) does not resolve in public DNS.

Fix Action

Fixed

PR fix notes

PR #61578: fix: recognize api.grok.x.ai as xAI-native endpoint

Description (problem / solution / changelog)

Summary

Fixes #61377

The provider attribution code in provider-attribution.ts only recognized api.x.ai as the xAI-native endpoint. The domain api.grok.x.ai was not recognized, causing it to fail endpoint classification and leading to web_search tool failures when this domain appears in DNS resolution or user configuration.

Changes

  • Added api.grok.x.ai as an alias for xai-native endpoint class in resolveProviderEndpoint()
  • Added corresponding test case

Testing

  • Added unit test verifying api.grok.x.ai resolves to xai-native endpoint class
  • Existing tests for api.x.ai remain unchanged

Changed files

  • openclaw-2026-04-03.log (removed, +0/-71)

PR #61871: fix: recognize api.grok.x.ai as xAI-native endpoint

Description (problem / solution / changelog)

Fixes #61377

Summary

The provider attribution code only recognized api.x.ai as the xAI-native endpoint. The domain api.grok.x.ai was not recognized, causing web_search tool failures when this domain appears in DNS resolution or user configuration.

Fix

Add api.grok.x.ai as an additional xAI-native alias in resolveProviderEndpoint().

Changed files

  • src/agents/provider-attribution.test.ts (modified, +4/-0)
  • src/agents/provider-attribution.ts (modified, +1/-1)
RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

The web_search tool fails when configured Grok. It silently aborts every request because the configured xAI Grok API endpoint in Openclaw (api.grok.x.ai) does not resolve in public DNS.

Steps to reproduce

  1. Configure Grok as a search provider.
  2. Ask an agent to do a web search.

Expected behavior

When requesting a web search, the agent should be able to use the web search tool configured with Grok and get results back successfully.

Actual behavior

The agent informs me that the web search tool is broken.

<img width="2518" height="1506" alt="Image" src="https://github.com/user-attachments/assets/5bfcaef6-3e2e-481f-a94f-2a9eb4dcd07c" />

OpenClaw version

latest

Operating system

Ubuntu 24.04

Install method

No response

Model

openrouter/qwen/qwen3.6-plus:free

Provider / routing chain

openclaw -> openrouter

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

No response

extent analysis

TL;DR

  • Update the xAI Grok API endpoint configuration in Openclaw to use a resolvable DNS name or a valid IP address.

Guidance

  • Verify the DNS resolution of the configured xAI Grok API endpoint (api.grok.x.ai) to confirm it does not resolve in public DNS.
  • Check the Openclaw configuration for any typos or incorrect settings that might prevent the endpoint from resolving.
  • Consider using a different DNS resolver or checking with the xAI Grok API provider for any known issues with their endpoint.
  • Test the web search tool with a different search provider to isolate the issue to the Grok configuration.

Example

No code snippet is provided as the issue does not require a code change, but rather a configuration update.

Notes

  • The fix assumes that the issue is solely due to the DNS resolution failure of the xAI Grok API endpoint.
  • Additional troubleshooting may be required if the issue persists after updating the endpoint configuration.

Recommendation

  • Apply workaround: Update the xAI Grok API endpoint configuration to use a resolvable DNS name or a valid IP address, as this is the most likely cause of the issue and can be resolved without waiting for a potential fix in a future version.

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

When requesting a web search, the agent should be able to use the web search tool configured with Grok and get results back successfully.

Still need to ship something?

×6

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

Back to top recommendations

TRENDING