[GH-ISSUE #4018] [BUG]: Cannot read properties of undefined (reading '0') #2554

Closed
opened 2026-02-22 18:30:13 -05:00 by yindo · 1 comment
Owner

Originally created by @mr-romeijn on GitHub (Jun 18, 2025).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/4018

How are you running AnythingLLM?

Docker (local)

What happened?

Issue happens both when running Docker & Local development mode.

When using @agent I never get a proper response. Im using the digital ocean inference API (OpenAPI generic). Using model 4o.. Normal chat works fine, albeit that the chat response only gets finished when I explicitly click the stop / cancel chat button.

Chat output:

@agent what tools do you have


Agent complete
Agent @agent invoked. Swapping over to agent chat. Type /exit to exit agent execution loop early.
system profile picture
 Could not respond to message.
Cannot read properties of undefined (reading '0')

Agent complete
Agent session complete.

Error log:

[backend] info: [AgentLLM - openai-gpt-4o] Will assume chat completion without tool call inputs.
[backend] error: Cannot read properties of undefined (reading '0') TypeError: Cannot read properties of undefined (reading '0')
    at GenericOpenAiProvider.complete (/app/server/utils/agents/aibitat/providers/genericOpenAi.js:97:38)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async AIbitat.handleExecution (/app/server/utils/agents/aibitat/index.js:607:24)
    at async AIbitat.reply (/app/server/utils/agents/aibitat/index.js:589:21)
    at async AIbitat.chat (/app/server/utils/agents/aibitat/index.js:387:15)
    at async AIbitat.start (/app/server/utils/agents/aibitat/index.js:321:5)
    at async /app/server/endpoints/agentWebsocket.js:52:7

Tried running @agent with a custom MCP server written using FastMCP, an existing MCP server (@modelcontextprotocol/server-everything) and no MCP servers at all. I just cannot get @agent to work.

Using PGVector as vector db

Are there known steps to reproduce?

No response

Originally created by @mr-romeijn on GitHub (Jun 18, 2025). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/4018 ### How are you running AnythingLLM? Docker (local) ### What happened? Issue happens both when running Docker & Local development mode. When using @agent I never get a proper response. Im using the digital ocean inference API (OpenAPI generic). Using model 4o.. Normal chat works fine, albeit that the chat response only gets finished when I explicitly click the stop / cancel chat button. Chat output: ``` @agent what tools do you have Agent complete Agent @agent invoked. Swapping over to agent chat. Type /exit to exit agent execution loop early. system profile picture Could not respond to message. Cannot read properties of undefined (reading '0') Agent complete Agent session complete. ``` Error log: ``` [backend] info: [AgentLLM - openai-gpt-4o] Will assume chat completion without tool call inputs. [backend] error: Cannot read properties of undefined (reading '0') TypeError: Cannot read properties of undefined (reading '0') at GenericOpenAiProvider.complete (/app/server/utils/agents/aibitat/providers/genericOpenAi.js:97:38) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async AIbitat.handleExecution (/app/server/utils/agents/aibitat/index.js:607:24) at async AIbitat.reply (/app/server/utils/agents/aibitat/index.js:589:21) at async AIbitat.chat (/app/server/utils/agents/aibitat/index.js:387:15) at async AIbitat.start (/app/server/utils/agents/aibitat/index.js:321:5) at async /app/server/endpoints/agentWebsocket.js:52:7 ``` Tried running @agent with a custom MCP server written using FastMCP, an existing MCP server (@modelcontextprotocol/server-everything) and no MCP servers at all. I just cannot get @agent to work. Using PGVector as vector db ### Are there known steps to reproduce? _No response_
yindo added the possible bug label 2026-02-22 18:30:13 -05:00
yindo closed this issue 2026-02-22 18:30:13 -05:00
Author
Owner

@shatfield4 commented on GitHub (Jun 18, 2025):

Have you tried just disabling all agent tools except for the built in AnythingLLM tools? Try removing all MCP servers and any other custom skills you have added (if any) then test the @agent out again.

If it is still not working after doing this then it must be your digital ocean inference API server. Sometimes when using a 3rd party to forward requests to a model like gpt-4o the 3rd party isn't using the same exact spec that we expect even though they say it is "OpenAI API compatible". I would suggest you try connecting directly to OpenAI with an API key and testing it there in order to narrow this down and figure out of it's your digital ocean server causing the issue.

Closing for now but if you are still having issues and can give me detailed instructions on how to replicate this problem, I'd be happy to reopen.

@shatfield4 commented on GitHub (Jun 18, 2025): Have you tried just disabling all agent tools except for the built in AnythingLLM tools? Try removing all MCP servers and any other custom skills you have added (if any) then test the @agent out again. If it is still not working after doing this then it must be your digital ocean inference API server. Sometimes when using a 3rd party to forward requests to a model like gpt-4o the 3rd party isn't using the same exact spec that we expect even though they say it is "OpenAI API compatible". I would suggest you try connecting directly to OpenAI with an API key and testing it there in order to narrow this down and figure out of it's your digital ocean server causing the issue. Closing for now but if you are still having issues and can give me detailed instructions on how to replicate this problem, I'd be happy to reopen.
yindo changed title from [BUG]: Cannot read properties of undefined (reading '0') to [GH-ISSUE #4018] [BUG]: Cannot read properties of undefined (reading '0') 2026-06-05 14:47:13 -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#2554