Fix goal recovery

This commit is contained in:
ms2k 2026-10-22 22:05:33 +09:00
commit 996f586bc1

View file

@ -57,16 +57,6 @@ func (e *errorInfo) UnmarshalJSON(data []byte) error {
return nil
}
func (e errorInfo) retryable() bool {
switch e.Kind {
case "serverOverloaded", "rateLimitExceeded", "internalServerError", "flexUnavailable":
return true
case "httpConnectionFailed", "responseStreamConnectionFailed", "responseStreamDisconnected", "responseTooManyFailedAttempts":
return e.HTTP == nil || *e.HTTP == 408 || *e.HTTP == 429 || *e.HTTP >= 500 && *e.HTTP <= 599
}
return false
}
type turn struct {
ID string `json:"id"`
Status string `json:"status"`
@ -85,6 +75,9 @@ type params struct {
type goalResult struct {
Goal *goal `json:"goal"`
}
type usageResult struct {
Allowed *bool `json:"ordinaryUsageAllowed"`
}
type turnsResult struct {
Data []turn `json:"data"`
}