Changes
PR #2092 by Resistor52: feat(openai): add GrokAI search grounding via xAI Responses API
- Added support for GrokAI search grounding via xAI's Responses API, fixing HTTP 422 errors caused by a hardcoded OpenAI
web_search_previewtool name inbuildResponseParams. - Introduced two new fields to
openai_compatible.ProviderConfig:WebSearchToolName(to override the default web search tool name) andEnableXSearch(to append xAI'sx_searchtool when search is enabled). - Both new fields default to empty/false, preserving full backwards compatibility for all existing providers.
- GrokAI is pre-configured with
WebSearchToolNameset to"web_search"andEnableXSearchset totrue, enabling grounded search results with real source URLs viafabric -V GrokAI --search. - Added tests in
openai_test.gocovering the new override paths and confirming default provider behavior remains unchanged.