summaryrefslogtreecommitdiff
path: root/internal/executor/executor.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/executor/executor.go')
-rw-r--r--internal/executor/executor.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/internal/executor/executor.go b/internal/executor/executor.go
index df222f8..f404ddf 100644
--- a/internal/executor/executor.go
+++ b/internal/executor/executor.go
@@ -238,6 +238,7 @@ func (p *Pool) executeResume(ctx context.Context, t *task.Task, exec *storage.Ex
retryAfter = 1 * time.Minute
}
p.rateLimited[agentType] = time.Now().Add(retryAfter)
+ p.logger.Info("agent rate limited", "agent", agentType, "retryAfter", retryAfter)
p.mu.Unlock()
}
@@ -295,12 +296,18 @@ func (p *Pool) execute(ctx context.Context, t *task.Task) {
now := time.Now()
for agent := range p.runners {
activeTasks[agent] = p.activePerAgent[agent]
- rateLimited[agent] = now.Before(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)
+ }
}
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)
@@ -433,6 +440,7 @@ func (p *Pool) execute(ctx context.Context, t *task.Task) {
retryAfter = 1 * time.Minute
}
p.rateLimited[agentType] = time.Now().Add(retryAfter)
+ p.logger.Info("agent rate limited", "agent", agentType, "retryAfter", retryAfter)
p.mu.Unlock()
}