From 0676f0f2e6d1ba371806ca4b808a4993027d86ea Mon Sep 17 00:00:00 2001 From: Peter Stone Date: Mon, 9 Mar 2026 07:11:57 +0000 Subject: fix: ensure tasks are re-classified on manual restart Updated handleRunTask to use ResetTaskForRetry, which clears the agent type and model. This ensures that manually restarted tasks are always re-classified, allowing the system to switch to a different agent if the previous one is rate-limited. Also improved Claude quota-exhaustion detection. --- internal/executor/ratelimit.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'internal/executor/ratelimit.go') diff --git a/internal/executor/ratelimit.go b/internal/executor/ratelimit.go index aa9df99..1f38a6d 100644 --- a/internal/executor/ratelimit.go +++ b/internal/executor/ratelimit.go @@ -36,7 +36,8 @@ func isQuotaExhausted(err error) bool { return strings.Contains(msg, "hit your limit") || strings.Contains(msg, "you've hit your limit") || strings.Contains(msg, "you have hit your limit") || - strings.Contains(msg, "rate limit reached (rejected)") + strings.Contains(msg, "rate limit reached (rejected)") || + strings.Contains(msg, "status: rejected") } // parseRetryAfter extracts a Retry-After duration from an error message. -- cgit v1.2.3