From c0ebe03704f39df14fe49212c03225df3cb588bb Mon Sep 17 00:00:00 2001 From: Ishaan Jaffer Date: Tue, 10 Mar 2026 17:40:16 -0700 Subject: [PATCH] fix(responses-api): fix whitespace token filter and MCP server URL construction - Drop the delta.trim() whitespace filter that was silently swallowing spaces and newlines during streaming, causing words to concatenate and paragraphs to collapse. Only skip truly empty strings (delta.length > 0). - Use proxyBaseUrl for MCP server_url construction instead of the hardcoded relative path "litellm_proxy/mcp", so non-root deployments route correctly. --- .../src/components/playground/llm_calls/responses_api.tsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/ui/litellm-dashboard/src/components/playground/llm_calls/responses_api.tsx b/ui/litellm-dashboard/src/components/playground/llm_calls/responses_api.tsx index dfe1fdb0ab1..6483319e118 100644 --- a/ui/litellm-dashboard/src/components/playground/llm_calls/responses_api.tsx +++ b/ui/litellm-dashboard/src/components/playground/llm_calls/responses_api.tsx @@ -98,7 +98,7 @@ export async function makeOpenAIResponsesRequest( tools.push({ type: "mcp", server_label: "litellm", - server_url: "litellm_proxy/mcp", + server_url: `${proxyBaseUrl}/mcp`, require_approval: "never", }); } else { @@ -111,7 +111,7 @@ export async function makeOpenAIResponsesRequest( tools.push({ type: "mcp", server_label: "litellm", - server_url: `litellm_proxy/mcp/${serverName}`, + server_url: `${proxyBaseUrl}/mcp/${serverName}`, require_approval: "never", ...(allowedTools.length > 0 ? { allowed_tools: allowedTools } : {}), }); @@ -197,8 +197,7 @@ export async function makeOpenAIResponsesRequest( if (event.type === "response.output_text.delta" && typeof event.delta === "string") { const delta = event.delta; console.log("Text delta", delta); - // skip pure whitespace/newlines - if (delta.trim().length > 0) { + if (delta.length > 0) { updateTextUI("assistant", delta, selectedModel); // Calculate time to first token