summaryrefslogtreecommitdiff
path: root/internal/executor/executor.go
diff options
context:
space:
mode:
authorPeter Stone <thepeterstone@gmail.com>2026-03-09 07:11:57 +0000
committerPeter Stone <thepeterstone@gmail.com>2026-03-10 09:29:02 +0000
commit0676f0f2e6d1ba371806ca4b808a4993027d86ea (patch)
treec8d6776d1b4f1b82e3ba2b392272f359fb0ca499 /internal/executor/executor.go
parenta62a19bbf774289e2018e50454aa719c1a2a9070 (diff)
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.
Diffstat (limited to 'internal/executor/executor.go')
-rw-r--r--internal/executor/executor.go8
1 files changed, 1 insertions, 7 deletions
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)