summaryrefslogtreecommitdiff
path: root/internal/executor
diff options
context:
space:
mode:
Diffstat (limited to 'internal/executor')
-rw-r--r--internal/executor/executor.go8
-rw-r--r--internal/executor/ratelimit.go3
2 files changed, 3 insertions, 8 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)
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.