sub2api
sub2api copied to clipboard
[BUG] FilterThinkingBlocksForRetry 未移除 thinking_strategy 字段导致重试仍然 400
问题描述
当请求包含 thinking_strategy(如 clear_thinking_20251015)时,sub2api 的 signature 错误重试机制会失败。
复现步骤
- 客户端发送包含 thinking blocks(带 signature)和
thinking_strategy: clear_thinking_20251015的请求 - Anthropic 返回 400:
invalid signature in thinking block - sub2api
[SignatureCheck]正确检测到 signature 错误 - sub2api 调用
FilterThinkingBlocksForRetry过滤 thinking blocks 并重试 - 重试请求中
thinking_strategy字段未被移除 - Anthropic 返回 400:
clear_thinking_20251015 strategy requires thinking to be enabled or adaptive - 此错误被标记为 non-retryable,最终返回 400 给客户端
日志证据
[SignatureCheck] Detected signature error
Account 1: detected thinking block signature error, retrying with filtered thinking blocks
[SignatureCheck] Checking error message: `clear_thinking_20251015` strategy requires `thinking` to be enabled or adaptive
[Forward] Upstream error (non-retryable): Account=1 Status=400
期望行为
FilterThinkingBlocksForRetry 在移除 thinking blocks 和顶层 thinking 配置的同时,也应移除 thinking_strategy 字段(如 clear_thinking_20251015),确保重试请求结构一致。
环境
- sub2api: latest (image date: 2026-02-18)
- 上游: Anthropic API
- 触发场景: Claude Code CLI 多轮对话中跨账号 thinking signature 不匹配
我也遇到了这个问题,你解决了吗