支持 Grok compaction 422 重试

This commit is contained in:
IanShaw
2026-08-20 06:08:34 -07:00
parent ad87ddee12
commit 17c0ee3859
@@ -119,7 +119,7 @@ func (s *OpenAIGatewayService) forwardGrokResponses(
// xAI can reject encrypted reasoning copied from a response produced under
// another account or cache identity. Retry once with the same routing and
// credential after removing only the rejected encrypted reasoning payload.
if attempt > 0 || resp.StatusCode != http.StatusBadRequest {
if attempt > 0 || (resp.StatusCode != http.StatusBadRequest && resp.StatusCode != http.StatusUnprocessableEntity) {
break
}
respBody := s.readUpstreamErrorBody(resp)