summaryrefslogtreecommitdiff
path: root/internal/storage/db.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/storage/db.go')
-rw-r--r--internal/storage/db.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/internal/storage/db.go b/internal/storage/db.go
index 31927a0..c396bbe 100644
--- a/internal/storage/db.go
+++ b/internal/storage/db.go
@@ -515,6 +515,15 @@ func scanTask(row scanner) (*task.Task, error) {
if err := json.Unmarshal([]byte(configJSON), &t.Agent); err != nil {
return nil, fmt.Errorf("unmarshaling agent config: %w", err)
}
+ // Fallback for legacy 'claude' field
+ if t.Agent.Instructions == "" {
+ var legacy struct {
+ Claude task.AgentConfig `json:"claude"`
+ }
+ if err := json.Unmarshal([]byte(configJSON), &legacy); err == nil && legacy.Claude.Instructions != "" {
+ t.Agent = legacy.Claude
+ }
+ }
if err := json.Unmarshal([]byte(retryJSON), &t.Retry); err != nil {
return nil, fmt.Errorf("unmarshaling retry: %w", err)
}