500 Internal Server Error when sending tool_calls array in request body. (Open AI compatible api) #1288

Closed
opened 2026-02-16 17:30:19 -05:00 by yindo · 1 comment
Owner

Originally created by @Shine1i on GitHub (Aug 13, 2025).

Title: 500 Internal Server Error when sending tool_calls array in request body

Description:
When using an OpenAI-compatible API (specifily Parasail in my case), I encountered a 500 Internal Server Error from https://api.parasail.io/v1/chat/completions only when the request body contains a tool_calls array.
If I remove tool_calls, the request succeeds as expected.

Steps to Reproduce:

  1. ask it to use like read tool (thats where it mostly fails)

interecepting the request and examining it i found that this specific part of the payload causes it to fail.

  "model": "parasail-glm45", 
  "messages": [
    {
      "role": "assistant",
      "content": "\n<think>....</think>\nI'll help you build this home page layout using Hero UI. Let me first explore the current project structure and then use the Hero UI MCP server to understand the available components.\n",
      "tool_calls": [
        {
          "id": "call_44ce0834dfd54bf18d4ab019",
          "type": "function",
          "function": {
            "name": "read",
            "arguments": "{\"filePath\":\"/home/wasim/Code/kato/package.json\"}"
          }
        }
      ]
    }
  ]
}

any ideas why parasail provider fails. works in roocode and other cli agents like crush.
PS. not all tools fails sometimes it can go on but at someone point fails. but for that specific tool after it calls it. it retry 4 times and 500.

Originally created by @Shine1i on GitHub (Aug 13, 2025). **Title:** 500 Internal Server Error when sending `tool_calls` array in request body **Description:** When using an OpenAI-compatible API (specifily Parasail in my case), I encountered a `500 Internal Server Error` from `https://api.parasail.io/v1/chat/completions` **only** when the request body contains a `tool_calls` array. If I remove `tool_calls`, the request succeeds as expected. **Steps to Reproduce:** 1. ask it to use like read tool (thats where it mostly fails) interecepting the request and examining it i found that this specific part of the payload causes it to fail. ```{ "model": "parasail-glm45", "messages": [ { "role": "assistant", "content": "\n<think>....</think>\nI'll help you build this home page layout using Hero UI. Let me first explore the current project structure and then use the Hero UI MCP server to understand the available components.\n", "tool_calls": [ { "id": "call_44ce0834dfd54bf18d4ab019", "type": "function", "function": { "name": "read", "arguments": "{\"filePath\":\"/home/wasim/Code/kato/package.json\"}" } } ] } ] } ``` any ideas why parasail provider fails. works in roocode and other cli agents like crush. PS. not all tools fails sometimes it can go on but at someone point fails. but for that specific tool after it calls it. it retry 4 times and 500.
yindo closed this issue 2026-02-16 17:30:19 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Aug 13, 2025):

👋 This issue might be a duplicate of existing issues. Please check:

  • #1890: Very similar issue with OpenCode sending tools parameter and Jinja tool templates to OpenAI-compatible APIs (llama.cpp) causing 500 errors. The issue describes the same core problem where OpenCode includes tools even when not configured, causing server-side failures.

If none of these address your specific case, please let us know how this issue differs.

@github-actions[bot] commented on GitHub (Aug 13, 2025): 👋 This issue might be a duplicate of existing issues. Please check: - #1890: Very similar issue with OpenCode sending tools parameter and Jinja tool templates to OpenAI-compatible APIs (llama.cpp) causing 500 errors. The issue describes the same core problem where OpenCode includes tools even when not configured, causing server-side failures. If none of these address your specific case, please let us know how this issue differs.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#1288