← Back to library

Anthropic 工具调用 ID 清洗,避免 provider 侧请求失败

针对 Anthropic provider 工具调用链路中 tool call ID 格式不稳定的问题,新增清洗与重配对修复;可直接用于排查‘偶发工具调用失败’场景。

GITHUBDiscovered 2026-02-12Author 0xRaini
Prerequisites
  • You are using Anthropic provider with tool-calling workflows enabled.
  • Gateway logs are retained so failed tool-call traces can be compared before/after upgrade.
Steps
  1. Record current failure baseline: count invalid tool-call errors in the last 24h.
  2. Upgrade to a build containing PR #13830 and PR #13926 fixes.
  3. Replay a known multi-tool conversation that previously failed after history truncation.
  4. Inspect logs and confirm tool_use pairing is repaired and no malformed ID is emitted.
  5. Keep a rollback tag for 24h and monitor error-rate delta.
Commands
openclaw gateway status
openclaw gateway restart
git log --oneline -n 20 | grep -E "13830|13926"
Verify

Previously reproducible Anthropic tool-call failures no longer occur and tool pairing remains stable across truncation cases.

Caveats
  • If failures persist, inspect custom middleware that rewrites tool payloads(需验证).
  • Do not disable validation globally just to mask malformed IDs.
Source attribution

This tip is aggregated from community/public sources and preserved with attribution.

Open original source ↗
Visit original post