From 88428260ce72760b85a0fd5e589eb6a4199194fa Mon Sep 17 00:00:00 2001 From: Omair Afzal <32237905+omair445@users.noreply.github.com> Date: Wed, 11 Feb 2026 05:27:35 +0500 Subject: [PATCH] fix(web_search): remove unsupported include param from Grok API calls (#12910) (#12945) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit xAI's /v1/responses endpoint does not support the 'include' parameter, returning 400 'Argument not supported: include'. Inline citations are returned automatically when available — no explicit request needed. Closes #12910 Co-authored-by: Luna AI --- src/agents/tools/web-search.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/agents/tools/web-search.ts b/src/agents/tools/web-search.ts index 242049e9b5..428c37f8a8 100644 --- a/src/agents/tools/web-search.ts +++ b/src/agents/tools/web-search.ts @@ -473,9 +473,10 @@ async function runGrokSearch(params: { tools: [{ type: "web_search" }], }; - if (params.inlineCitations) { - body.include = ["inline_citations"]; - } + // Note: xAI's /v1/responses endpoint does not support the `include` + // parameter (returns 400 "Argument not supported: include"). Inline + // citations are returned automatically when available — we just parse + // them from the response without requesting them explicitly (#12910). const res = await fetch(XAI_API_ENDPOINT, { method: "POST",