[GH-ISSUE #3273] [BUG]: maybe Agent flow bug LLM processing failed: Cannot read properties of null (reading 'length') TypeError: Cannot read properties of null (reading 'length') #2103

Closed
opened 2026-02-22 18:28:09 -05:00 by yindo · 2 comments
Owner

Originally created by @qigaode on GitHub (Feb 19, 2025).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/3273

How are you running AnythingLLM?

Docker (remote machine)

What happened?

No errors reported for workspace use models

but agent flow error

1/8 Agent @agent invoked. Swapping over to agent chat. Type /exit to exit agent execution loop early.
2/8 [debug]: @agent is attempting to call flow_1fdc0377-05ff-4469-b4e6-70a4fd00d6b1 tool
3/8 Executing flow: exportData
4/8 Making POST request to external API...
5/8 Sending body to http://192.168.1.100:12000/api/wonder-chat-ai/test/exportDataPackage: {"certificate_no":"33333"}
6/8 API call completed
7/8 Processing data with LLM instruction...
8/8 Sending request to LLM...
9/9 Flow failed: Unknown error

[backend] info: [AgentHandler] Attached flow flow_1fdc0377-05ff-4469-b4e6-70a4fd00d6b1 (导出数据包) plugin to Agent cluster
2025-02-19T08:02:40.424315552Z [backend] info: [AgentLLM - glm-4-flash] Valid tool call found - running flow_1fdc0377-05ff-4469-b4e6-70a4fd00d6b1.
2025-02-19T08:02:40.424500419Z [backend] info: [AgentHandler] [debug]: @agent is attempting to call flow_1fdc0377-05ff-4469-b4e6-70a4fd00d6b1 tool
2025-02-19T08:02:40.425282016Z [backend] info: [TELEMETRY SENT] {"event":"agent_flow_execution_started","distinctId":"0876f199-c63f-44cc-b390-98616e383066","properties":{"runtime":"docker"}}
2025-02-19T08:02:40.425475469Z [backend] info: [AgentHandler] [AgentFlowToolExecutor] - executing API Call block
2025-02-19T08:02:40.581035348Z [backend] info: [AgentHandler] [AgentFlowToolExecutor] - executing LLM Instruction block
2025-02-19T08:02:40.581124676Z [backend] info: [AgentHandler] Sending request to LLM (generic-openai::glm-4-flash)
2025-02-19T08:02:40.581468611Z [backend] info: [AgentHandler] LLM processing failed: Cannot read properties of null (reading 'length') TypeError: Cannot read properties of null (reading 'length')
2025-02-19T08:02:40.581476797Z at GenericOpenAiProvider.complete (/app/server/utils/agents/aibitat/providers/genericOpenAi.js:67:21)
2025-02-19T08:02:40.581480564Z at executeLLMInstruction (/app/server/utils/agentFlows/executors/llm-instruction.js:34:39)
2025-02-19T08:02:40.581483820Z at FlowExecutor.executeStep (/app/server/utils/agentFlows/executor.js:87:24)
2025-02-19T08:02:40.581487376Z at FlowExecutor.executeFlow (/app/server/utils/agentFlows/executor.js:129:35)
2025-02-19T08:02:40.581490823Z at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
2025-02-19T08:02:40.581494309Z at async AgentFlows.executeFlow (/app/server/utils/agentFlows/index.js:151:12)
2025-02-19T08:02:40.581497586Z at async Object.handler (/app/server/utils/agentFlows/index.js:202:30)
2025-02-19T08:02:40.581500541Z at async AIbitat.handleExecution (/app/server/utils/agents/aibitat/index.js:634:22)
2025-02-19T08:02:40.581503877Z at async AIbitat.reply (/app/server/utils/agents/aibitat/index.js:578:21)
2025-02-19T08:02:40.581507083Z at async AIbitat.chat (/app/server/utils/agents/aibitat/index.js:374:15)
2025-02-19T08:02:42.874821287Z [backend] info: [AgentLLM - glm-4-flash] Function tool with exact arguments has already been called this stack.
2025-02-19T08:02:42.874868465Z [backend] info: [AgentLLM - glm-4-flash] Will assume chat completion without tool call inputs.`

Are there known steps to reproduce?

No response

Originally created by @qigaode on GitHub (Feb 19, 2025). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/3273 ### How are you running AnythingLLM? Docker (remote machine) ### What happened? No errors reported for workspace use models but agent flow error 1/8 Agent @agent invoked. Swapping over to agent chat. Type /exit to exit agent execution loop early. 2/8 [debug]: @agent is attempting to call `flow_1fdc0377-05ff-4469-b4e6-70a4fd00d6b1` tool 3/8 Executing flow: exportData 4/8 Making POST request to external API... 5/8 Sending body to http://192.168.1.100:12000/api/wonder-chat-ai/test/exportDataPackage: {"certificate_no":"33333"} 6/8 API call completed 7/8 Processing data with LLM instruction... 8/8 Sending request to LLM... 9/9 Flow failed: Unknown error [backend] info: [AgentHandler] Attached flow flow_1fdc0377-05ff-4469-b4e6-70a4fd00d6b1 (导出数据包) plugin to Agent cluster 2025-02-19T08:02:40.424315552Z [backend] info: [AgentLLM - glm-4-flash] Valid tool call found - running flow_1fdc0377-05ff-4469-b4e6-70a4fd00d6b1. 2025-02-19T08:02:40.424500419Z [backend] info: [AgentHandler] [debug]: @agent is attempting to call `flow_1fdc0377-05ff-4469-b4e6-70a4fd00d6b1` tool 2025-02-19T08:02:40.425282016Z [backend] info: [TELEMETRY SENT] {"event":"agent_flow_execution_started","distinctId":"0876f199-c63f-44cc-b390-98616e383066","properties":{"runtime":"docker"}} 2025-02-19T08:02:40.425475469Z [backend] info: [AgentHandler] [AgentFlowToolExecutor] - executing API Call block 2025-02-19T08:02:40.581035348Z [backend] info: [AgentHandler] [AgentFlowToolExecutor] - executing LLM Instruction block 2025-02-19T08:02:40.581124676Z [backend] info: [AgentHandler] Sending request to LLM (generic-openai::glm-4-flash) 2025-02-19T08:02:40.581468611Z [backend] info: [AgentHandler] LLM processing failed: Cannot read properties of null (reading 'length') TypeError: Cannot read properties of null (reading 'length') 2025-02-19T08:02:40.581476797Z at GenericOpenAiProvider.complete (/app/server/utils/agents/aibitat/providers/genericOpenAi.js:67:21) 2025-02-19T08:02:40.581480564Z at executeLLMInstruction (/app/server/utils/agentFlows/executors/llm-instruction.js:34:39) 2025-02-19T08:02:40.581483820Z at FlowExecutor.executeStep (/app/server/utils/agentFlows/executor.js:87:24) 2025-02-19T08:02:40.581487376Z at FlowExecutor.executeFlow (/app/server/utils/agentFlows/executor.js:129:35) 2025-02-19T08:02:40.581490823Z at process.processTicksAndRejections (node:internal/process/task_queues:95:5) 2025-02-19T08:02:40.581494309Z at async AgentFlows.executeFlow (/app/server/utils/agentFlows/index.js:151:12) 2025-02-19T08:02:40.581497586Z at async Object.handler (/app/server/utils/agentFlows/index.js:202:30) 2025-02-19T08:02:40.581500541Z at async AIbitat.handleExecution (/app/server/utils/agents/aibitat/index.js:634:22) 2025-02-19T08:02:40.581503877Z at async AIbitat.reply (/app/server/utils/agents/aibitat/index.js:578:21) 2025-02-19T08:02:40.581507083Z at async AIbitat.chat (/app/server/utils/agents/aibitat/index.js:374:15) 2025-02-19T08:02:42.874821287Z [backend] info: [AgentLLM - glm-4-flash] Function tool with exact arguments has already been called this stack. 2025-02-19T08:02:42.874868465Z [backend] info: [AgentLLM - glm-4-flash] Will assume chat completion without tool call inputs.` ### Are there known steps to reproduce? _No response_
yindo added the possible bug label 2026-02-22 18:28:09 -05:00
yindo closed this issue 2026-02-22 18:28:09 -05:00
Author
Owner

@ctcanbol commented on GitHub (Feb 19, 2025):

Thanks for the quick fix!

Now after using latest version, the error message changed:

 [backend] info: [AgentLLM - llama3.1:8b] Valid tool call found - running flow_78fcd5ca-aab0-49e4-8fed-e7a79f473865.
 [backend] info: [AgentHandler] [debug]: @agent is attempting to call `flow_78fcd5ca-aab0-49e4-8fed-e7a79f473865` tool
 [backend] info: [AgentHandler] [AgentFlowToolExecutor] - executing API Call block
 [backend] info: [AgentHandler] [AgentFlowToolExecutor] - executing LLM Instruction block
 [backend] info: [AgentHandler] Sending request to LLM (ollama::llama3.1:8b)
 [backend] info: [AgentHandler] LLM processing failed: Cannot read properties of null (reading 'length') TypeError: Cannot read properties of null (reading 'length')
     at OllamaProvider.complete (/app/server/utils/agents/aibitat/providers/ollama.js:49:21)
     at executeLLMInstruction (/app/server/utils/agentFlows/executors/llm-instruction.js:34:39)
     at FlowExecutor.executeStep (/app/server/utils/agentFlows/executor.js:87:24)
     at FlowExecutor.executeFlow (/app/server/utils/agentFlows/executor.js:129:35)
     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
     at async AgentFlows.executeFlow (/app/server/utils/agentFlows/index.js:151:12)
     at async Object.handler (/app/server/utils/agentFlows/index.js:202:30)
     at async AIbitat.handleExecution (/app/server/utils/agents/aibitat/index.js:634:22)
     at async AIbitat.reply (/app/server/utils/agents/aibitat/index.js:578:21)
     at async AIbitat.chat (/app/server/utils/agents/aibitat/index.js:374:15)

Originally posted by @ctcanbol in #3248

I have the same issue.

@ctcanbol commented on GitHub (Feb 19, 2025): > Thanks for the quick fix! > > Now after using latest version, the error message changed: > > ``` > [backend] info: [AgentLLM - llama3.1:8b] Valid tool call found - running flow_78fcd5ca-aab0-49e4-8fed-e7a79f473865. > [backend] info: [AgentHandler] [debug]: @agent is attempting to call `flow_78fcd5ca-aab0-49e4-8fed-e7a79f473865` tool > [backend] info: [AgentHandler] [AgentFlowToolExecutor] - executing API Call block > [backend] info: [AgentHandler] [AgentFlowToolExecutor] - executing LLM Instruction block > [backend] info: [AgentHandler] Sending request to LLM (ollama::llama3.1:8b) > [backend] info: [AgentHandler] LLM processing failed: Cannot read properties of null (reading 'length') TypeError: Cannot read properties of null (reading 'length') > at OllamaProvider.complete (/app/server/utils/agents/aibitat/providers/ollama.js:49:21) > at executeLLMInstruction (/app/server/utils/agentFlows/executors/llm-instruction.js:34:39) > at FlowExecutor.executeStep (/app/server/utils/agentFlows/executor.js:87:24) > at FlowExecutor.executeFlow (/app/server/utils/agentFlows/executor.js:129:35) > at process.processTicksAndRejections (node:internal/process/task_queues:95:5) > at async AgentFlows.executeFlow (/app/server/utils/agentFlows/index.js:151:12) > at async Object.handler (/app/server/utils/agentFlows/index.js:202:30) > at async AIbitat.handleExecution (/app/server/utils/agents/aibitat/index.js:634:22) > at async AIbitat.reply (/app/server/utils/agents/aibitat/index.js:578:21) > at async AIbitat.chat (/app/server/utils/agents/aibitat/index.js:374:15) > ``` _Originally posted by @ctcanbol in [#3248](https://github.com/Mintplex-Labs/anything-llm/issues/3248#issuecomment-2668261251)_ I have the same issue.
Author
Owner

@Abid320 commented on GitHub (Mar 8, 2025):


@Abid320 commented on GitHub (Mar 8, 2025): ****
yindo changed title from [BUG]: maybe Agent flow bug LLM processing failed: Cannot read properties of null (reading 'length') TypeError: Cannot read properties of null (reading 'length') to [GH-ISSUE #3273] [BUG]: maybe Agent flow bug LLM processing failed: Cannot read properties of null (reading 'length') TypeError: Cannot read properties of null (reading 'length') 2026-06-05 14:44:33 -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#2103