Skip to content

fix(openai): bridge gpt-5.6+ tools to /v1/responses without reasoning… - #54

Merged
lkapadiya-DO merged 1 commit into
release/v1.94.0-do.1from
lkapadiya/gpt-5.6+-tools-responses-bridge
Jul 30, 2026
Merged

fix(openai): bridge gpt-5.6+ tools to /v1/responses without reasoning…#54
lkapadiya-DO merged 1 commit into
release/v1.94.0-do.1from
lkapadiya/gpt-5.6+-tools-responses-bridge

Conversation

@lkapadiya-DO

@lkapadiya-DO lkapadiya-DO commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

…_effort

Implement BerriAI#34043 on the 1.94.0 DO release line so gpt-5.6 family tool calls on chat/completions auto-route to Responses even when reasoning_effort is unset. Keep gpt-5.4/5.5 tools-only on chat completions.

OpenAI rejects gpt-5.6 family tool calls on chat/completions when a default reasoning_effort is applied server-side. Port BerriAI#34043 onto the DO release bridge so tools-only requests auto-route to Responses.

JIRA: https://do-internal.atlassian.net/browse/INF-991

Relevant issues

BerriAI#33221

Test

Case 1: 5.6 + tools, no reasoning_effort
Request:

curl -sS -X POST "$BASE_URL/v1/chat/completions" \
  -H "Authorization: Bearer $MODEL_ACCESS_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai-gpt-5.6-sol",
    "messages": [
      {
        "role": "user",
        "content": "What'\''s the weather like in Boston today? in celsius"
      }
    ],
    "tools": [
      {
        "type": "function",
        "function": {
          "name": "get_current_weather",
          "description": "Get the current weather in a given location",
          "parameters": {
            "type": "object",
            "properties": {
              "location": {
                "type": "string",
                "description": "The city and state, e.g. San Francisco, CA"
              },
              "unit": {
                "type": "string",
                "enum": ["celsius", "fahrenheit"]
              }
            },
            "required": ["location"]
          }
        }
      }
    ]
  }' | jq .

Response(Before this change):

{
  "error": {
    "message": "Function tools with reasoning_effort are not supported for gpt-5.6-sol in /v1/chat/completions. To use function tools, use /v1/responses or set reasoning_effort to 'none'.",
    "type": "invalid_request_error"
  },
  "message": "Function tools with reasoning_effort are not supported for gpt-5.6-sol in /v1/chat/completions. To use function tools, use /v1/responses or set reasoning_effort to 'none'.",
  "status_code": 400
}

Response(After this change):

{
  "choices": [
    {
      "finish_reason": "tool_calls",
      "index": 0,
      "logprobs": null,
      "message": {
        "content": null,
        "reasoning_content": null,
        "refusal": null,
        "role": "assistant",
        "tool_calls": [
          {
            "function": {
              "arguments": "{\"location\":\"Boston, MA\",\"unit\":\"celsius\"}",
              "name": "get_current_weather"
            },
            "id": "call_sVZWp6N06UeVte1rBQ4gHmvm",
            "type": "function"
          }
        ]
      }
    }
  ],
  "created": 1785253709,
  "id": "chatcmpl-1820079d-330f-46a0-8a86-58f1ee1f28b6",
  "model": "openai-gpt-5.6-sol",
  "object": "chat.completion",
  "usage": {
    "cache_created_input_tokens": 0,
    "cache_creation": {
      "ephemeral_1h_input_tokens": 0,
      "ephemeral_5m_input_tokens": 0
    },
    "cache_read_input_tokens": 0,
    "completion_tokens": 26,
    "completion_tokens_details": {
      "reasoning_tokens": 0
    },
    "prompt_tokens": 82,
    "prompt_tokens_details": {
      "cached_tokens": 0
    },
    "speed": null,
    "total_tokens": 108
  }
}

Case 2: Streaming + tools, no reasoning_effort

Request:

curl -sS -N -X POST "$BASE_URL/v1/chat/completions" \
  -H "Authorization: Bearer $MODEL_ACCESS_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai-gpt-5.6-sol",
    "stream": true,
    "messages": [{"role": "user", "content": "Weather in Boston. Use the tool."}],
    "tools": [{
      "type": "function",
      "function": {
        "name": "get_current_weather",
        "description": "Get weather",
        "parameters": {
          "type": "object",
          "properties": {"location": {"type": "string"}},
          "required": ["location"]
        }
      }
    }]
  }'

Response(Before this change):

{"error":{"message":"Function tools with reasoning_effort are not supported for gpt-5.6-sol in /v1/chat/completions. To use function tools, use /v1/responses or set reasoning_effort to 'none'.","type":"invalid_request_error"},"message":"Function tools with reasoning_effort are not supported for gpt-5.6-sol in /v1/chat/completions. To use function tools, use /v1/responses or set reasoning_effort to 'none'.","status_code":400}

Response(After this change):

data: {"choices":[{"delta":{"content":"","role":"assistant"},"finish_reason":null,"index":0,"logprobs":null}],"created":1785256488,"id":"chatcmpl-d5bc9dd0-decf-4339-bc69-fdd043c3a97e","model":"openai-gpt-5.6-sol","object":"chat.completion.chunk"}

data: {"choices":[{"delta":{"tool_calls":[{"function":{"arguments":"","name":"get_current_weather"},"id":"call_Ek9RoMV8xcH9STAV4YYU58X3","index":0,"type":"function"}]},"finish_reason":null,"index":0,"logprobs":null}],"created":1785256488,"id":"chatcmpl-d5bc9dd0-decf-4339-bc69-fdd043c3a97e","model":"openai-gpt-5.6-sol","object":"chat.completion.chunk"}

data: {"choices":[{"delta":{"tool_calls":[{"function":{"arguments":"{\""},"index":0,"type":"function"}]},"finish_reason":null,"index":0,"logprobs":null}],"created":1785256488,"id":"chatcmpl-64f417da-6343-4b46-88cd-fd08d5dc0c97","model":"openai-gpt-5.6-sol","object":"chat.completion.chunk"}

data: {"choices":[{"delta":{"tool_calls":[{"function":{"arguments":"location"},"index":0,"type":"function"}]},"finish_reason":null,"index":0,"logprobs":null}],"created":1785256488,"id":"chatcmpl-f7f1f16c-2394-4599-899b-340e5a8b50a4","model":"openai-gpt-5.6-sol","object":"chat.completion.chunk"}

data: {"choices":[{"delta":{"tool_calls":[{"function":{"arguments":"\":\""},"index":0,"type":"function"}]},"finish_reason":null,"index":0,"logprobs":null}],"created":1785256488,"id":"chatcmpl-b9b48f4a-ec3e-407c-8a2c-5804e5be06db","model":"openai-gpt-5.6-sol","object":"chat.completion.chunk"}

data: {"choices":[{"delta":{"tool_calls":[{"function":{"arguments":"Boston"},"index":0,"type":"function"}]},"finish_reason":null,"index":0,"logprobs":null}],"created":1785256488,"id":"chatcmpl-fe730778-bc4f-4f5b-89af-90caff9d4e65","model":"openai-gpt-5.6-sol","object":"chat.completion.chunk"}

data: {"choices":[{"delta":{"tool_calls":[{"function":{"arguments":","},"index":0,"type":"function"}]},"finish_reason":null,"index":0,"logprobs":null}],"created":1785256488,"id":"chatcmpl-4e05f9da-ffc3-4a21-92a3-594490d675eb","model":"openai-gpt-5.6-sol","object":"chat.completion.chunk"}

data: {"choices":[{"delta":{"tool_calls":[{"function":{"arguments":" MA"},"index":0,"type":"function"}]},"finish_reason":null,"index":0,"logprobs":null}],"created":1785256488,"id":"chatcmpl-7f319d6a-53c1-48d0-873e-b6b02ffdeafd","model":"openai-gpt-5.6-sol","object":"chat.completion.chunk"}

data: {"choices":[{"delta":{"tool_calls":[{"function":{"arguments":"\"}"},"index":0,"type":"function"}]},"finish_reason":null,"index":0,"logprobs":null}],"created":1785256488,"id":"chatcmpl-5a95f24e-82b9-4f62-a911-20d22b07180f","model":"openai-gpt-5.6-sol","object":"chat.completion.chunk"}

data: {"choices":[{"delta":{},"finish_reason":"tool_calls","index":0,"logprobs":null}],"created":1785256488,"id":"chatcmpl-79e8ca2a-b0b1-475d-bfdb-f927bc22088d","model":"openai-gpt-5.6-sol","object":"chat.completion.chunk"}

data: {"choices":[],"created":1785256488,"id":"chatcmpl-79e8ca2a-b0b1-475d-bfdb-f927bc22088d","model":"openai-gpt-5.6-sol","object":"chat.completion.chunk","usage":{"cache_created_input_tokens":0,"cache_creation":{"ephemeral_1h_input_tokens":0,"ephemeral_5m_input_tokens":0},"cache_read_input_tokens":0,"completion_tokens":21,"completion_tokens_details":{"reasoning_tokens":0},"prompt_tokens":48,"prompt_tokens_details":{"cached_tokens":0},"speed":null,"total_tokens":69}}

data: [DONE]

Case 3: Multi-tool call

Request:

curl -sS -X POST "$BASE_URL/v1/chat/completions" \
  -H "Authorization: Bearer $MODEL_ACCESS_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai-gpt-5.6-sol",
    "messages": [{"role": "user", "content": "What is the weather in Boston and the time in UTC? Use tools."}],
    "tools": [
      {
        "type": "function",
        "function": {
          "name": "get_current_weather",
          "description": "Get weather",
          "parameters": {
            "type": "object",
            "properties": {"location": {"type": "string"}},
            "required": ["location"]
          }
        }
      },
      {
        "type": "function",
        "function": {
          "name": "get_time",
          "description": "Get current time for a timezone",
          "parameters": {
            "type": "object",
            "properties": {"timezone": {"type": "string"}},
            "required": ["timezone"]
          }
        }
      }
    ]
  }' | jq '{finish: .choices[0].finish_reason, tools: [.choices[0].message.tool_calls[]?.function.name], error}'

Response(Before this change):

{
  "finish": null,
  "tools": [],
  "error": {
    "message": "Function tools with reasoning_effort are not supported for gpt-5.6-sol in /v1/chat/completions. To use function tools, use /v1/responses or set reasoning_effort to 'none'.",
    "type": "invalid_request_error"
  }
}

Response(After this change):

{
  "finish": "tool_calls",
  "tools": [
    "get_current_weather",
    "get_time"
  ],
  "error": null
}

Test plan
[x] Unit: responses_api_bridge + is_model_gpt_5_6_plus tests
[x] Preview via inference-proxy

…_effort

Re-implement BerriAI#34043 on the 1.94.0 DO release line so gpt-5.6
family tool calls on chat/completions auto-route to Responses even when
reasoning_effort is unset. Keep gpt-5.4/5.5 tools-only on chat completions.

Co-authored-by: Cursor <cursoragent@cursor.com>
@lkapadiya-DO
lkapadiya-DO marked this pull request as ready for review July 30, 2026 22:19
@lukesorvikDO
lukesorvikDO self-requested a review July 30, 2026 23:07
@lkapadiya-DO
lkapadiya-DO merged commit 1fd8b38 into release/v1.94.0-do.1 Jul 30, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants