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/executor.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'internal/executor/executor.go') diff --git a/internal/executor/executor.go b/internal/executor/executor.go index 8924830..c04f68e 100644 --- a/internal/executor/executor.go +++ b/internal/executor/executor.go @@ -355,18 +355,12 @@ func (p *Pool) execute(ctx context.Context, t *task.Task) { if deadline, ok := p.rateLimited[agent]; ok && now.After(deadline) { delete(p.rateLimited, agent) } - activeUntil := p.rateLimited[agent] - isLimited := now.Before(activeUntil) - rateLimited[agent] = isLimited - if isLimited { - p.logger.Debug("agent rate limited", "agent", agent, "until", activeUntil) - } + rateLimited[agent] = now.Before(p.rateLimited[agent]) } status := SystemStatus{ ActiveTasks: activeTasks, RateLimited: rateLimited, } - p.logger.Debug("classifying task", "taskID", t.ID, "status", status) p.mu.Unlock() cls, err := p.Classifier.Classify(ctx, t.Name, t.Agent.Instructions, status) -- cgit v1.2.3