From 1bbbb44d2ba8c19d3c8c3ba8bbe02bbd0ce18dfb Mon Sep 17 00:00:00 2001 From: clawsweeper <274271284+clawsweeper[bot]@users.noreply.github.com> Date: Tue, 19 May 2026 01:43:33 +0000 Subject: [PATCH] fix(deepseek): normalize mcp union tool schemas Co-authored-by: Andy Ye <35905412+TurboTheTurtle@users.noreply.github.com> Co-authored-by: clawsweeper[bot] <274271284+clawsweeper[bot]@users.noreply.github.com> --- CHANGELOG.md | 2 +- src/agents/pi-embedded-runner/compact.ts | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a011921694..77d4d7965a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -57,7 +57,7 @@ Docs: https://docs.openclaw.ai - Agents/subagents: keep collect-mode announce queues batching unresolved-origin items with compatible same-route messages and resume collection after a true cross-channel drain when a later compatible batch remains. Fixes #83577. - Skills: refresh existing session skill snapshots when watched skill roots change, so changed extra skill directories take effect without starting a new session. Fixes #83782. (#83800) Thanks @hclsys. - Providers/Anthropic: preserve native image input for current Claude model rows when stale local catalog data marks them text-only. (#83756) Thanks @TurboTheTurtle. -- Providers/DeepSeek: normalize MCP tool schemas with `anyOf`/`oneOf` unions before sending them to DeepSeek, preventing union-shaped parameters from being rejected. (#83766) Thanks @TurboTheTurtle. +- Providers/DeepSeek: normalize MCP tool schemas with `anyOf`/`oneOf` unions before normal and compaction requests reach DeepSeek, preventing union-shaped parameters from being rejected. (#83766) Thanks @TurboTheTurtle. - Control UI: render live tool progress from session-scoped `session.tool` Gateway events so externally started runs show their tool cards in the active session. (#83734) Thanks @TurboTheTurtle. - Outbound: resolve send-capable channel plugins from the active runtime registry when the pinned startup registry only has setup metadata. (#83733) Thanks @TurboTheTurtle. - Control UI: keep the chat delete confirmation popover clamped inside the visible viewport on small screens. (#83804) Thanks @ThiagoCAltoe. diff --git a/src/agents/pi-embedded-runner/compact.ts b/src/agents/pi-embedded-runner/compact.ts index a2636dffa82..781a318650a 100644 --- a/src/agents/pi-embedded-runner/compact.ts +++ b/src/agents/pi-embedded-runner/compact.ts @@ -811,7 +811,11 @@ async function compactEmbeddedPiSessionDirectOnce( senderIsOwner: params.senderIsOwner, warn: (message) => log.warn(message), }); - const effectiveTools = [...tools, ...filteredBundledTools]; + const normalizedBundledTools = + filteredBundledTools.length > 0 + ? runtimePlan.tools.normalize(filteredBundledTools, runtimePlanModelContext) + : filteredBundledTools; + const effectiveTools = [...tools, ...normalizedBundledTools]; const allowedToolNames = collectAllowedToolNames({ tools: effectiveTools }); runtimePlan.tools.logDiagnostics(effectiveTools, runtimePlanModelContext); const machineName = await getMachineDisplayName();