summaryrefslogtreecommitdiff
path: root/internal/storage
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/storage
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/storage')
-rw-r--r--internal/storage/db.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/internal/storage/db.go b/internal/storage/db.go
index b8a7085..043009c 100644
--- a/internal/storage/db.go
+++ b/internal/storage/db.go
@@ -251,6 +251,18 @@ func (s *DB) ResetTaskForRetry(id string) (*task.Task, error) {
return t, nil
}
+// UpdateTaskAgent updates only the agent configuration of a task.
+func (s *DB) UpdateTaskAgent(id string, agent task.AgentConfig) error {
+ configJSON, err := json.Marshal(agent)
+ if err != nil {
+ return fmt.Errorf("marshaling agent config: %w", err)
+ }
+ now := time.Now().UTC()
+ _, err = s.db.Exec(`UPDATE tasks SET config_json = ?, updated_at = ? WHERE id = ?`,
+ string(configJSON), now, id)
+ return err
+}
+
// RejectTask sets a task's state to PENDING and stores the rejection comment.
func (s *DB) RejectTask(id, comment string) error {
now := time.Now().UTC()