Bug Description
When using the /claude/v1/chat/completions endpoint with tools, the response correctly sets finish_reason: "tool_calls" but the actual tool_calls array is missing from the message object.
Steps to Reproduce
- Send a request to
/claude/v1/chat/completions with tools defined
- Ask Claude to use the tool (e.g., "Get my gmail messages")
- Observe the response
Expected Behavior
{
"choices": [{
"finish_reason": "tool_calls",
"message": {
"role": "assistant",
"content": null,
"tool_calls": [{
"id": "toolu_xxx",
"type": "function",
"function": {
"name": "get_gmail",
"arguments": "{}"
}
}]
}
}]
}
Actual Behavior
{
"choices": [{
"finish_reason": "tool_calls",
"message": {
"role": "assistant",
"content": ""
}
}]
}
The tool_calls array is completely missing.
Root Cause
In ccproxy/llms/formatters/anthropic_to_openai/responses.py, the convert__anthropic_message_to_openai_chat__response function handles text and thinking blocks but does not handle tool_use blocks from Anthropic's response.
Impact
This breaks integration with OpenAI-compatible clients that rely on the tool_calls array, including:
- n8n AI Agent workflows - The agent sees tools are available but tool calls are never executed
- Any other automation platform using OpenAI-compatible function calling
Environment
- CCProxy-API version: v0.2.0
- Endpoint:
/claude/v1/chat/completions
Fix
I've submitted a PR with the fix: #34
Bug Description
When using the
/claude/v1/chat/completionsendpoint with tools, the response correctly setsfinish_reason: "tool_calls"but the actualtool_callsarray is missing from the message object.Steps to Reproduce
/claude/v1/chat/completionswith tools definedExpected Behavior
{ "choices": [{ "finish_reason": "tool_calls", "message": { "role": "assistant", "content": null, "tool_calls": [{ "id": "toolu_xxx", "type": "function", "function": { "name": "get_gmail", "arguments": "{}" } }] } }] }Actual Behavior
{ "choices": [{ "finish_reason": "tool_calls", "message": { "role": "assistant", "content": "" } }] }The
tool_callsarray is completely missing.Root Cause
In
ccproxy/llms/formatters/anthropic_to_openai/responses.py, theconvert__anthropic_message_to_openai_chat__responsefunction handlestextandthinkingblocks but does not handletool_useblocks from Anthropic's response.Impact
This breaks integration with OpenAI-compatible clients that rely on the
tool_callsarray, including:Environment
/claude/v1/chat/completionsFix
I've submitted a PR with the fix: #34