Merge pull request #468 from s-Joshua-s/fix/thinking-block-modification-error

fix(api): 修复 thinking 块被意外修改导致的 400 错误
This commit is contained in:
Wesley Liddick
2026-02-03 22:21:06 +08:00
committed by GitHub
3 changed files with 134 additions and 12 deletions

View File

@@ -1168,6 +1168,12 @@ func isSignatureRelatedError(respBody []byte) bool {
return true
}
// Detect thinking block modification errors:
// "thinking or redacted_thinking blocks in the latest assistant message cannot be modified"
if strings.Contains(msg, "cannot be modified") && (strings.Contains(msg, "thinking") || strings.Contains(msg, "redacted_thinking")) {
return true
}
return false
}