fix(tools): correct Grok response parsing for xAI Responses API#13049
Merged
Takhoffman merged 2 commits intoopenclaw:mainfrom Feb 10, 2026
Merged
fix(tools): correct Grok response parsing for xAI Responses API#13049Takhoffman merged 2 commits intoopenclaw:mainfrom
Takhoffman merged 2 commits intoopenclaw:mainfrom
Conversation
d372868 to
725d354
Compare
Contributor
Author
Takhoffman
added a commit
to ereid7/openclaw
that referenced
this pull request
Feb 10, 2026
725d354 to
42e59ba
Compare
The xAI Responses API returns content in output[0].content[0].text, not in output_text field. Updated GrokSearchResponse type and runGrokSearch to extract content from the correct path. Fixes the 'No response' issue when using Grok web search.
42e59ba to
07a429e
Compare
Contributor
This was referenced Feb 10, 2026
lucasmpramos
pushed a commit
to butley/openclaw
that referenced
this pull request
Feb 10, 2026
…claw#13049) * fix(tools): correct Grok response parsing for xAI Responses API The xAI Responses API returns content in output[0].content[0].text, not in output_text field. Updated GrokSearchResponse type and runGrokSearch to extract content from the correct path. Fixes the 'No response' issue when using Grok web search. * fix(tools): harden Grok web_search parsing (openclaw#13049) (thanks @ereid7) --------- Co-authored-by: erai <[email protected]> Co-authored-by: Tak Hoffman <[email protected]>
ProgramCaiCai
pushed a commit
to ProgramCaiCai/openclaw
that referenced
this pull request
Feb 10, 2026
…claw#13049) * fix(tools): correct Grok response parsing for xAI Responses API The xAI Responses API returns content in output[0].content[0].text, not in output_text field. Updated GrokSearchResponse type and runGrokSearch to extract content from the correct path. Fixes the 'No response' issue when using Grok web search. * fix(tools): harden Grok web_search parsing (openclaw#13049) (thanks @ereid7) --------- Co-authored-by: erai <[email protected]> Co-authored-by: Tak Hoffman <[email protected]>
YanHaidao
added a commit
to YanHaidao/clawdbot
that referenced
this pull request
Feb 10, 2026
* 'main' of github.com:YanHaidao/clawdbot: (94 commits) fix(auto-reply): prevent sender spoofing in group prompts Discord: add exec approval cleanup option (openclaw#13205) CI: extend stale timelines to be contributor-friendly (openclaw#13209) fix: enforce Discord agent component DM auth (openclaw#11254) (thanks @thedudeabidesai) refactor(security,config): split oversized files (openclaw#13182) Commands: add commands.allowFrom config CI: configure stale automation fix(signal): enforce mention gating for group messages (openclaw#13124) fix(ui): prioritize displayName over label in webchat session picker (openclaw#13108) Chore: add testflight auto-response Docker: include A2UI sources for bundle (openclaw#13114) fix: unify session maintenance and cron run pruning (openclaw#13083) docs: expand vulnerability reporting guidelines in SECURITY.md docs: add vulnerability reporting guidelines to CONTRIBUTING.md refactor: consolidate fetchWithTimeout into shared utility fix(memory): default batch embeddings to off Improve code analyzer for independent packages, CI: only run release-check on push to main fix(tools): correct Grok response parsing for xAI Responses API (openclaw#13049) chore(deps): update dependencies, remove hono pinning Update contributing, deduplicate more functions ...
Hansen1018
pushed a commit
to Hansen1018/openclaw
that referenced
this pull request
Feb 10, 2026
…claw#13049) * fix(tools): correct Grok response parsing for xAI Responses API The xAI Responses API returns content in output[0].content[0].text, not in output_text field. Updated GrokSearchResponse type and runGrokSearch to extract content from the correct path. Fixes the 'No response' issue when using Grok web search. * fix(tools): harden Grok web_search parsing (openclaw#13049) (thanks @ereid7) --------- Co-authored-by: erai <[email protected]> Co-authored-by: Tak Hoffman <[email protected]>
michaelleone
pushed a commit
to michaelleone/openclaw
that referenced
this pull request
Feb 11, 2026
…claw#13049) * fix(tools): correct Grok response parsing for xAI Responses API The xAI Responses API returns content in output[0].content[0].text, not in output_text field. Updated GrokSearchResponse type and runGrokSearch to extract content from the correct path. Fixes the 'No response' issue when using Grok web search. * fix(tools): harden Grok web_search parsing (openclaw#13049) (thanks @ereid7) --------- Co-authored-by: erai <[email protected]> Co-authored-by: Tak Hoffman <[email protected]>
skyhawk14
pushed a commit
to skyhawk14/openclaw
that referenced
this pull request
Feb 13, 2026
…claw#13049) * fix(tools): correct Grok response parsing for xAI Responses API The xAI Responses API returns content in output[0].content[0].text, not in output_text field. Updated GrokSearchResponse type and runGrokSearch to extract content from the correct path. Fixes the 'No response' issue when using Grok web search. * fix(tools): harden Grok web_search parsing (openclaw#13049) (thanks @ereid7) --------- Co-authored-by: erai <[email protected]> Co-authored-by: Tak Hoffman <[email protected]>
zooqueen
pushed a commit
to hanzoai/bot
that referenced
this pull request
Mar 6, 2026
…claw#13049) * fix(tools): correct Grok response parsing for xAI Responses API The xAI Responses API returns content in output[0].content[0].text, not in output_text field. Updated GrokSearchResponse type and runGrokSearch to extract content from the correct path. Fixes the 'No response' issue when using Grok web search. * fix(tools): harden Grok web_search parsing (openclaw#13049) (thanks @ereid7) --------- Co-authored-by: erai <[email protected]> Co-authored-by: Tak Hoffman <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Grok web_search provider returns "No response" for all queries because the response parsing code expects "output_text" field, but xAI's Responses API returns content in "output[0].content[0].text".
Changes
Testing
Verified fix works with live xAI API:
Related
Fixes bug introduced in PR #12419
Checklist
Greptile Overview
Greptile Summary
This PR extends
web_searchto support Grok (xAI) and fixes Grok parsing by reading the xAI Responses API’soutput[0].content[0].text(with a fallback to the legacyoutput_textfield). It also adds Grok config resolution helpers (apiKey/model/inline citations), updates the tools config types + runtime zod schema to acceptprovider: "grok"and atools.web.search.grokconfig block, and adds unit tests for the new Grok config resolution behavior.Confidence Score: 4/5
contentis returned withoutwrapWebContent(...)unlike the other providers, which can bypass existing external-content handling and affect downstream rendering/consumption.(2/5) Greptile learns from your feedback when you react with thumbs up/down!
Context used:
dashboard- CLAUDE.md (source)dashboard- AGENTS.md (source)