mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-10-28 00:07:33 +00:00
normalizeOpenAIParallelToolCallsWithoutTools only looked at the top-level "tools" array, but normalizeOpenAIResponsesLiteTools moves namespace tools into an input item of type "additional_tools" and deletes the top-level key. A Responses Lite request that carries tools therefore looks like it has none, and the parallel_tool_calls:false that ensureOpenAIResponsesLiteParallelToolCalls had just pinned gets deleted on the way out. OpenAI then applies its default of true and rejects the request: 400 unsupported_value: "X-OpenAI-Internal-Codex-Responses-Lite requires `parallel_tool_calls` to be false." Note the field cannot simply be pinned to false unconditionally: without tools OpenAI rejects it with "'parallel_tool_calls' is only allowed when 'tools' are specified", so the two constraints have to be honoured together. Reuse the same tool-detection standard the Lite path already uses by adding openAIRequestBodyHasTools, the []byte counterpart of openAIResponsesLiteHasTools, so both sides of the repo agree on what "has tools" means. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>