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:
parent
4d34fd47d8
commit
d49274a431
1 changed files with 1 additions and 1 deletions
|
|
@ -2070,7 +2070,7 @@ turnLoop:
|
||||||
strings.Contains(errMsg, "prompt is too long") ||
|
strings.Contains(errMsg, "prompt is too long") ||
|
||||||
strings.Contains(errMsg, "request too large"))
|
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 {
|
if isServerError && retry < maxRetries {
|
||||||
backoff := time.Duration(retry+1) * 5 * time.Second
|
backoff := time.Duration(retry+1) * 5 * time.Second
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue