summaryrefslogtreecommitdiff
path: root/internal/api
diff options
context:
space:
mode:
authorPeter Stone <thepeterstone@gmail.com>2026-03-08 21:41:08 +0000
committerPeter Stone <thepeterstone@gmail.com>2026-03-08 21:41:08 +0000
commite6e1e7cd6d79eb969345e738f2554108681ade95 (patch)
tree461526162e42d4468c4d4be12fb1f6ad779efd79 /internal/api
parent14dcbc4804ff70b50278a0654006a0c1927dd586 (diff)
fix: restore task execution broken by add-gemini merge
- handleCreateTask: add legacy "claude" key fallback in input struct so old clients and YAML files sending claude:{...} still work - cli/create: send "agent" key instead of "claude"; add --agent-type flag - storage/db_test: fix ClaudeConfig → AgentConfig after rename Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'internal/api')
-rw-r--r--internal/api/server.go20
1 files changed, 13 insertions, 7 deletions
diff --git a/internal/api/server.go b/internal/api/server.go
index 3d7cb1e..34e1872 100644
--- a/internal/api/server.go
+++ b/internal/api/server.go
@@ -346,19 +346,25 @@ func (s *Server) handleHealth(w http.ResponseWriter, r *http.Request) {
func (s *Server) handleCreateTask(w http.ResponseWriter, r *http.Request) {
var input struct {
- Name string `json:"name"`
- Description string `json:"description"`
- Agent task.AgentConfig `json:"agent"`
- Timeout string `json:"timeout"`
- Priority string `json:"priority"`
- Tags []string `json:"tags"`
- ParentTaskID string `json:"parent_task_id"`
+ Name string `json:"name"`
+ Description string `json:"description"`
+ Agent task.AgentConfig `json:"agent"`
+ Claude task.AgentConfig `json:"claude"` // legacy alias
+ Timeout string `json:"timeout"`
+ Priority string `json:"priority"`
+ Tags []string `json:"tags"`
+ ParentTaskID string `json:"parent_task_id"`
}
if err := json.NewDecoder(r.Body).Decode(&input); err != nil {
writeJSON(w, http.StatusBadRequest, map[string]string{"error": "invalid JSON: " + err.Error()})
return
}
+ // Accept legacy "claude" key when "agent" is not provided.
+ if input.Agent.Instructions == "" && input.Claude.Instructions != "" {
+ input.Agent = input.Claude
+ }
+
now := time.Now().UTC()
t := &task.Task{
ID: uuid.New().String(),