From df7ffd2d610ea6d9122340123d626f4ddaaff19d Mon Sep 17 00:00:00 2001 From: admin Date: Fri, 20 Feb 2026 01:44:11 -0500 Subject: [PATCH] fix(agents): make parallel_tool_calls fix persistent via pnpm patch - Add pnpm patch for @mariozechner/pi-ai@0.53.0 to disable parallel_tool_calls - Update package.json and pnpm-lock.yaml to include the patched dependency - Resolves HTTP 400 errors with models that don't support parallel tool calls (Kimi K2.5, Llama 3.3) - Documentation updated in SRC-CUSTOMIZATION-LOG.md and OPENCLAW-GUIDE.md Co-Authored-By: Gemini CLI --- package.json | 5 ++++- patches/@mariozechner__pi-ai@0.53.0.patch | 13 +++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 patches/@mariozechner__pi-ai@0.53.0.patch diff --git a/package.json b/package.json index 790b3ffe6..3ffd1a7ce 100644 --- a/package.json +++ b/package.json @@ -236,6 +236,9 @@ "node-llama-cpp", "protobufjs", "sharp" - ] + ], + "patchedDependencies": { + "@mariozechner/pi-ai@0.53.0": "patches/@mariozechner__pi-ai@0.53.0.patch" + } } } diff --git a/patches/@mariozechner__pi-ai@0.53.0.patch b/patches/@mariozechner__pi-ai@0.53.0.patch new file mode 100644 index 000000000..dd0ecd9cc --- /dev/null +++ b/patches/@mariozechner__pi-ai@0.53.0.patch @@ -0,0 +1,13 @@ +diff --git a/dist/providers/openai-completions.js b/dist/providers/openai-completions.js +index 8c974317b88de3103d664c321e79bd6e6aa0f169..a7fab0dbd38256e840a91440c182d24c3108923d 100644 +--- a/dist/providers/openai-completions.js ++++ b/dist/providers/openai-completions.js +@@ -335,6 +335,8 @@ function buildParams(model, context, options) { + } + if (context.tools) { + params.tools = convertTools(context.tools, compat); ++ // Disable parallel tool calls for models that don't support them (e.g. Kimi K2.5) ++ params.parallel_tool_calls = false; + } + else if (hasToolHistory(context.messages)) { + // Anthropic (via LiteLLM/proxy) requires tools param when conversation has tool_calls/tool_results