summaryrefslogtreecommitdiff
path: root/internal/executor/executor.go
diff options
context:
space:
mode:
authorClaudomator Agent <agent@claudomator>2026-03-14 07:04:47 +0000
committerClaudomator Agent <agent@claudomator>2026-03-14 07:04:47 +0000
commite0e81bbdaae37353803d47fa59a36d0472f8146d (patch)
treef4ca72b78926edd4a37acfc9feebc1bf30c2aee9 /internal/executor/executor.go
parente5864d941e31a0e4ce59e31bee13e9c7c43909f4 (diff)
feat: persist agent assignment before task execution
- Add UpdateTaskAgent to Store interface and DB implementation - Call UpdateTaskAgent in Pool.execute to persist assigned agent/model to database before the runner starts - Update runTask in app.js to pass selected agent as query param Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'internal/executor/executor.go')
-rw-r--r--internal/executor/executor.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/internal/executor/executor.go b/internal/executor/executor.go
index bf209b7..475d150 100644
--- a/internal/executor/executor.go
+++ b/internal/executor/executor.go
@@ -28,6 +28,7 @@ type Store interface {
UpdateTaskQuestion(taskID, questionJSON string) error
UpdateTaskSummary(taskID, summary string) error
AppendTaskInteraction(taskID string, interaction task.Interaction) error
+ UpdateTaskAgent(id string, agent task.AgentConfig) error
}
// LogPather is an optional interface runners can implement to provide the log
@@ -435,6 +436,11 @@ func (p *Pool) execute(ctx context.Context, t *task.Task) {
}
}
+ // Persist the assigned agent (and model) to the database before running.
+ if err := p.store.UpdateTaskAgent(t.ID, t.Agent); err != nil {
+ p.logger.Error("failed to persist agent config", "error", err, "taskID", t.ID)
+ }
+
agentType := t.Agent.Type
if agentType == "" {
agentType = "claude"