fix(claude): honor disable_parallel_tool_use

This commit is contained in:
Darley
2026-03-17 19:17:41 +08:00
parent db63f9b5d6
commit 19e1a4447a
2 changed files with 53 additions and 1 deletions

View File

@@ -271,8 +271,14 @@ func ConvertClaudeRequestToCodex(modelName string, inputRawJSON []byte, _ bool)
}
}
// Default to parallel tool calls unless the client explicitly disables them.
parallelToolCalls := true
if disableParallelToolUse := rootResult.Get("disable_parallel_tool_use"); disableParallelToolUse.Exists() {
parallelToolCalls = !disableParallelToolUse.Bool()
}
// Add additional configuration parameters for the Codex API.
template, _ = sjson.Set(template, "parallel_tool_calls", true)
template, _ = sjson.Set(template, "parallel_tool_calls", parallelToolCalls)
// Convert thinking.budget_tokens to reasoning.effort.
reasoningEffort := "medium"