From e6e1e7cd6d79eb969345e738f2554108681ade95 Mon Sep 17 00:00:00 2001 From: Peter Stone Date: Sun, 8 Mar 2026 21:41:08 +0000 Subject: fix: restore task execution broken by add-gemini merge MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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 --- internal/api/server.go | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'internal/api') 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(), -- cgit v1.2.3