Skip to content

Never stop coding. Free MIT AI gateway: one endpoint, 375 providers (150+ free), 1,400+ models Kimi, Claude, GPT, Gemini, GLM, DeepSeek, MiniMax. Works with Claude Code, Codex, Cursor, OpenCode, Cline & Copilot. Quota-aware auto-fallback, RTK+Caveman compression saves 15-95% tokens, MCP/A2A, Desktop/PWA. Built by 900+ contributors

fix(combo): trigger fallback on Anthropic thinking block signature errors (#1696)

diegosouzapw00ae48f58d9a
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9c3f51433c..ad4488b5cb 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -25,6 +25,7 @@
- **fix(stream):** fail zombie SSE streams before accepting response — returns 504 instead of hanging indefinitely, enables combo fallback (#1693)
- **fix(combo):** complete context truncation hotfix — cache getCombos() with 10s TTL, pass allCombosData to resolveComboTargets() for nested combo resolution, consolidate duplicated context overflow regex patterns (#1685)
- **fix(codex):** raise default quota threshold from 90% to 99% to avoid premature account blocking when usable quota remains (#1697)
+- **fix(combo):** trigger fallback on Anthropic `Invalid signature in thinking block` errors instead of returning 400 directly (#1696)
- **fix:** combo retry loop stops immediately on client disconnect (499) (#1681)
- **fix(search):** support optional bearer auth for SearXNG (#1683)
- **fix(vision):** respect native GPT vision support — prevents VisionBridge from intercepting models that already handle images natively (#1678)
diff --git a/open-sse/services/combo.ts b/open-sse/services/combo.ts
index 9bdc8ee2eb..00d31d9d3e 100644
--- a/open-sse/services/combo.ts
+++ b/open-sse/services/combo.ts
@@ -101,6 +101,8 @@ const COMBO_BAD_REQUEST_FALLBACK_PATTERNS = [
/\bfunction'?s? name (?:can't|can not|is|has) (?:blank|empty|missing)/i,
/function.*name.*(?:blank|empty|missing)/i,
/tool_call.*name.*(?:blank|empty|missing)/i,
+ // Anthropic thinking block signature errors — stale/expired signatures cannot be retried (#1696)
+ /invalid.*signature.*thinking/i,
];
// Patterns that signal all accounts for a provider are rate-limited / exhausted.
diff --git a/tests/unit/combo-routing-engine.test.ts b/tests/unit/combo-routing-engine.test.ts
index 0cb75bde1a..29fab4fd29 100644
--- a/tests/unit/combo-routing-engine.test.ts
+++ b/tests/unit/combo-routing-engine.test.ts
@@ -803,6 +803,15 @@ test("shouldFallbackComboBadRequest only flags known provider-scoped 400 pattern
assert.equal(shouldFallbackComboBadRequest(400, "无法响应该请求"), true);
// Generic "please check" should NOT match (was too broad before)
assert.equal(shouldFallbackComboBadRequest(400, "请检查您的参数"), false);
+ // Anthropic thinking block signature errors (#1696)
+ assert.equal(
+ shouldFallbackComboBadRequest(
+ 400,
+ "[400]: messages.31.content.0: Invalid `signature` in `thinking` block"
+ ),
+ true
+ );
+ assert.equal(shouldFallbackComboBadRequest(400, "Invalid signature in thinking block"), true);
});
test("handleComboChat accepts binary and Responses-style 200 bodies but falls through malformed success payloads", async () => {