diff options
Diffstat (limited to 'internal/api')
| -rw-r--r-- | internal/api/server.go | 20 |
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(), |
