fix(agent): use strings.ToLower for case-insensitive HTTP status check

The error message format is "Status: %d" (capital S) but the
check was using lowercase "status: 5". Using strings.ToLower()
ensures case-insensitive matching.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
merlinmiao 2026-04-05 19:34:41 +08:00
parent 4d34fd47d8
commit d49274a431

View file

@ -2070,7 +2070,7 @@ turnLoop:
strings.Contains(errMsg, "prompt is too long") ||
strings.Contains(errMsg, "request too large"))
isServerError := !isTimeoutError && strings.Contains(errMsg, "status: 5")
isServerError := !isTimeoutError && strings.Contains(strings.ToLower(errMsg), "status: 5")
if isServerError && retry < maxRetries {
backoff := time.Duration(retry+1) * 5 * time.Second