diff options
Diffstat (limited to 'internal/executor/executor.go')
| -rw-r--r-- | internal/executor/executor.go | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/internal/executor/executor.go b/internal/executor/executor.go index 7ae4e2d..bf209b7 100644 --- a/internal/executor/executor.go +++ b/internal/executor/executor.go @@ -414,19 +414,24 @@ func (p *Pool) execute(ctx context.Context, t *task.Task) { } p.mu.Unlock() - // Deterministically pick the agent with fewest active tasks. - selectedAgent := pickAgent(status) - if selectedAgent != "" { - t.Agent.Type = selectedAgent - } + // If a specific agent is already requested, skip selection and classification. + skipClassification := t.Agent.Type == "claude" || t.Agent.Type == "gemini" + + if !skipClassification { + // Deterministically pick the agent with fewest active tasks. + selectedAgent := pickAgent(status) + if selectedAgent != "" { + t.Agent.Type = selectedAgent + } - if p.Classifier != nil { - cls, err := p.Classifier.Classify(ctx, t.Name, t.Agent.Instructions, status, t.Agent.Type) - if err == nil { - p.logger.Info("task classified", "taskID", t.ID, "agent", t.Agent.Type, "model", cls.Model, "reason", cls.Reason) - t.Agent.Model = cls.Model - } else { - p.logger.Error("classification failed", "error", err, "taskID", t.ID) + if p.Classifier != nil { + cls, err := p.Classifier.Classify(ctx, t.Name, t.Agent.Instructions, status, t.Agent.Type) + if err == nil { + p.logger.Info("task classified", "taskID", t.ID, "agent", t.Agent.Type, "model", cls.Model, "reason", cls.Reason) + t.Agent.Model = cls.Model + } else { + p.logger.Error("classification failed", "error", err, "taskID", t.ID) + } } } |
