packages/ai-openai/TROUBLESHOOTING.md
If you're experiencing tool call errors like:
400 No tool call found for function call output with <UUID>
Good news: Tool calls are now automatically handled correctly. The system automatically routes tool calls to the Chat Completions API even when Response API is enabled, ensuring reliable functionality without any user intervention required.
The OpenAI Response API has fundamental compatibility issues with tool calling that prevent reliable function calling. The API has different message formats, tool call semantics, and state management requirements.
As of the latest version:
To verify the automatic routing is working:
Model <id>: Request contains tools, falling back to Chat Completions APISet useResponseApi: true/false in your model configuration. Tool calls will automatically use Chat Completions API regardless.
OpenAI API error: 400 - Invalid request: messages[X]: role 'developer' is not supported
Some OpenAI models (particularly o1-preview and o1-mini) do not support the 'developer' role in messages.
This is handled automatically for known models. For custom endpoints with unsupported models:
developerMessageSettings to 'user' or 'system' in your custom model configuration:{
"model": "o1-mini",
"url": "https://api.openai.com/v1",
"developerMessageSettings": "user"
}
'mergeWithFollowingUserMessage' to combine system messages with user messages.Error: Please provide OPENAI_API_KEY in preferences or via environment variable
Solutions:
export OPENAI_API_KEY=your_key_hereFor custom OpenAI-compatible endpoints, ensure:
If you experience issues with the automatic tool call routing, please report:
The Response API will be used for tool calls once OpenAI resolves the underlying compatibility issues. The current automatic routing approach ensures users get working tool calls without manual intervention.