I encountered an Error: 400 status code (no body) when using the creatReactAgent method #222

Closed
opened 2026-02-15 17:17:31 -05:00 by yindo · 1 comment
Owner

Originally created by @loverara on GitHub (Mar 31, 2025).

library version

"langchain": "^0.3.19",
"@langchain/community": "^0.3.32",
"@langchain/core": "^0.3.40",
"@langchain/langgraph": "^0.2.49",
"@langchain/mcp-adapters": "^0.3.3",
"@langchain/openai": "^0.4.4"

The tools used are from the MCP server converted by @ langchain/mcp adapters

error messages
[NEST] 2025-03-31 16:26:46 error [AIFaucet.rootOutput] Error: 400 status code (no body) at Function.generate (/Users/loverara/Documents/code_workspace/vscode_workspace/ifuncun/agent_template/node_modules/openai/src/error.ts:72:14) at OpenAI.makeStatusError (/Users/loverara/Documents/code_workspace/vscode_workspace/ifuncun/agent_template/node_modules/openai/src/core.ts:443:21) at OpenAI.makeRequest (/Users/loverara/Documents/code_workspace/vscode_workspace/ifuncun/agent_template/node_modules/openai/src/core.ts:507:24) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async /Users/loverara/Documents/code_workspace/vscode_workspace/ifuncun/agent_template/node_modules/@langchain/openai/dist/chat_models.cjs:1528:29

The error message I received when debugging to method completionWithRetry is
'{"object":"error","message":"\\"auto\\" tool choice requires --enable-auto-tool-choice and --tool-call-parser to be set","type":"BadRequestError","param":null,"code":400}'

Originally created by @loverara on GitHub (Mar 31, 2025). library version ``` "langchain": "^0.3.19", "@langchain/community": "^0.3.32", "@langchain/core": "^0.3.40", "@langchain/langgraph": "^0.2.49", "@langchain/mcp-adapters": "^0.3.3", "@langchain/openai": "^0.4.4" ``` The tools used are from the MCP server converted by @ langchain/mcp adapters error messages `[NEST] 2025-03-31 16:26:46 error [AIFaucet.rootOutput] Error: 400 status code (no body) at Function.generate (/Users/loverara/Documents/code_workspace/vscode_workspace/ifuncun/agent_template/node_modules/openai/src/error.ts:72:14) at OpenAI.makeStatusError (/Users/loverara/Documents/code_workspace/vscode_workspace/ifuncun/agent_template/node_modules/openai/src/core.ts:443:21) at OpenAI.makeRequest (/Users/loverara/Documents/code_workspace/vscode_workspace/ifuncun/agent_template/node_modules/openai/src/core.ts:507:24) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async /Users/loverara/Documents/code_workspace/vscode_workspace/ifuncun/agent_template/node_modules/@langchain/openai/dist/chat_models.cjs:1528:29` The error message I received when debugging to method completionWithRetry is `'{"object":"error","message":"\\"auto\\" tool choice requires --enable-auto-tool-choice and --tool-call-parser to be set","type":"BadRequestError","param":null,"code":400}'`
yindo closed this issue 2026-02-15 17:17:31 -05:00
Author
Owner

@knightswatch3 commented on GitHub (Apr 24, 2025):

What was the issue ? I am facing this too. @loverara

@knightswatch3 commented on GitHub (Apr 24, 2025): What was the issue ? I am facing this too. @loverara
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langgraphjs#222