[GH-ISSUE #5030] [BUG]: Gemini.stream in aibitat failing to process the web search agent #3156

Closed
opened 2026-02-22 18:32:49 -05:00 by yindo · 0 comments
Owner

Originally created by @fienen on GitHub (Feb 20, 2026).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/5030

Originally assigned to: @angelplusultra on GitHub.

How are you running AnythingLLM?

Docker (remote machine)

What happened?

When using Gemini as the LLM, trying to use the web search agent results in a 400 (No Body) error. Gemini is incredibly strict about the handshake during tool calls, so it's likely there's just something minor going on in the API. It's able to connect and make the initial search and retrieve results, but fails when handing those results off back to the LLM for rendering. I tried modifying some settings like GEMINI_SAFETY_SETTING and the LLM temperature to see if it was an issue the results themselves, but that made no difference.

I also confirmed that this problem goes away using other LLMs, such as Claude or ChatGPT, while leaving everything else the same.

Image

[backend] info: [AgentHandler] Start b52f05ec-19ac-4750-8ca9-73de93b36010::gemini:gemini-flash-latest [backend] info: [AgentHandler] Attached websocket plugin to Agent cluster [backend] info: [AgentHandler] Attached chat-history plugin to Agent cluster [backend] info: [AgentHandler] Attaching user and default agent to Agent cluster. [backend] info: [MCPHypervisor] Successfully started 0 MCP servers: [] [backend] info: [AgentHandler] Attached rag-memory plugin to Agent cluster [backend] info: [AgentHandler] Attached document-summarizer plugin to Agent cluster [backend] info: [AgentHandler] Attached web-scraping plugin to Agent cluster [backend] info: [AgentHandler] Attached create-chart plugin to Agent cluster [backend] info: [AgentHandler] Attached save-file-to-browser plugin to Agent cluster [backend] info: [AgentHandler] Attached web-browsing plugin to Agent cluster [backend] info: [AgentHandler] Attached flow flow_c3126ce6-19a5-4448-b399-9922b36a1f80 (Summarize URL) plugin to Agent cluster [backend] info: [AgentHandler] [DEBUG] Provider supports agent streaming - will use async execution! [backend] info: [AgentLLM - gemini-flash-latest] Gemini.stream - will process this chat completion. [backend] info: [AgentHandler] [debug]: @agent is attempting to call web-browsingtool { "query": "most popular girls baby names US 2025 predictions trends" } [backend] info: [AgentLLM - gemini-flash-latest] Gemini.stream - will process this chat completion. [backend] error: error: 400 status code (no body) Error: 400 status code (no body) at GeminiProvider.stream (/app/server/utils/agents/aibitat/providers/gemini.js:228:15) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async AIbitat.handleAsyncExecution (/app/server/utils/agents/aibitat/index.js:651:30) at async AIbitat.handleAsyncExecution (/app/server/utils/agents/aibitat/index.js:721:14) at async AIbitat.reply (/app/server/utils/agents/aibitat/index.js:607:17) at async AIbitat.chat (/app/server/utils/agents/aibitat/index.js:388:15) at async AIbitat.start (/app/server/utils/agents/aibitat/index.js:322:5) at async /app/server/endpoints/agentWebsocket.js:52:7 [backend] info: [AgentHandler] End b52f05ec-19ac-4750-8ca9-73de93b36010::gemini:gemini-flash-latest

Are there known steps to reproduce?

  1. Use AnythingLLM through the web interface (I did not verify if this issue exists in the desktop version)
  2. Set Gemini as the LLM provider (I specifically saw it with gemini-flash-latest)
  3. Enable the Web Search agent. I don't think the search provider matters. I reproduced it with Google, DuckDuckGo, and Tavily.
  4. Create a thread and invoke @agent with a search query
Originally created by @fienen on GitHub (Feb 20, 2026). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/5030 Originally assigned to: @angelplusultra on GitHub. ### How are you running AnythingLLM? Docker (remote machine) ### What happened? When using Gemini as the LLM, trying to use the web search agent results in a 400 (No Body) error. Gemini is incredibly strict about the handshake during tool calls, so it's likely there's just something minor going on in the API. It's able to connect and make the initial search and retrieve results, but fails when handing those results off back to the LLM for rendering. I tried modifying some settings like `GEMINI_SAFETY_SETTING` and the LLM temperature to see if it was an issue the results themselves, but that made no difference. I also confirmed that this problem goes away using other LLMs, such as Claude or ChatGPT, while leaving everything else the same. <img width="1091" height="758" alt="Image" src="https://github.com/user-attachments/assets/da97ab4d-22fa-455f-b638-322a8c56f6c7" /> `[backend] info: [AgentHandler] Start b52f05ec-19ac-4750-8ca9-73de93b36010::gemini:gemini-flash-latest [backend] info: [AgentHandler] Attached websocket plugin to Agent cluster [backend] info: [AgentHandler] Attached chat-history plugin to Agent cluster [backend] info: [AgentHandler] Attaching user and default agent to Agent cluster. [backend] info: [MCPHypervisor] Successfully started 0 MCP servers: [] [backend] info: [AgentHandler] Attached rag-memory plugin to Agent cluster [backend] info: [AgentHandler] Attached document-summarizer plugin to Agent cluster [backend] info: [AgentHandler] Attached web-scraping plugin to Agent cluster [backend] info: [AgentHandler] Attached create-chart plugin to Agent cluster [backend] info: [AgentHandler] Attached save-file-to-browser plugin to Agent cluster [backend] info: [AgentHandler] Attached web-browsing plugin to Agent cluster [backend] info: [AgentHandler] Attached flow flow_c3126ce6-19a5-4448-b399-9922b36a1f80 (Summarize URL) plugin to Agent cluster [backend] info: [AgentHandler] [DEBUG] Provider supports agent streaming - will use async execution! [backend] info: [AgentLLM - gemini-flash-latest] Gemini.stream - will process this chat completion. [backend] info: [AgentHandler] [debug]: @agent is attempting to call `web-browsing` tool { "query": "most popular girls baby names US 2025 predictions trends" } [backend] info: [AgentLLM - gemini-flash-latest] Gemini.stream - will process this chat completion. [backend] error: error: 400 status code (no body) Error: 400 status code (no body) at GeminiProvider.stream (/app/server/utils/agents/aibitat/providers/gemini.js:228:15) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async AIbitat.handleAsyncExecution (/app/server/utils/agents/aibitat/index.js:651:30) at async AIbitat.handleAsyncExecution (/app/server/utils/agents/aibitat/index.js:721:14) at async AIbitat.reply (/app/server/utils/agents/aibitat/index.js:607:17) at async AIbitat.chat (/app/server/utils/agents/aibitat/index.js:388:15) at async AIbitat.start (/app/server/utils/agents/aibitat/index.js:322:5) at async /app/server/endpoints/agentWebsocket.js:52:7 [backend] info: [AgentHandler] End b52f05ec-19ac-4750-8ca9-73de93b36010::gemini:gemini-flash-latest ` ### Are there known steps to reproduce? 1. Use AnythingLLM through the web interface (I did not verify if this issue exists in the desktop version) 2. Set Gemini as the LLM provider (I specifically saw it with `gemini-flash-latest`) 3. Enable the Web Search agent. I don't think the search provider matters. I reproduced it with Google, DuckDuckGo, and Tavily. 4. Create a thread and invoke `@agent` with a search query
yindo added the possible bugcore-team-onlyinvestigating labels 2026-02-22 18:32:49 -05:00
yindo changed title from [BUG]: Gemini.stream in aibitat failing to process the web search agent to [GH-ISSUE #5030] [BUG]: Gemini.stream in aibitat failing to process the web search agent 2026-06-05 14:50:36 -04:00
yindo closed this issue 2026-06-05 14:50:37 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#3156