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/cli/create.go | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'internal/cli/create.go') diff --git a/internal/cli/create.go b/internal/cli/create.go index addd034..e5435d3 100644 --- a/internal/cli/create.go +++ b/internal/cli/create.go @@ -15,6 +15,7 @@ func newCreateCmd() *cobra.Command { instructions string workingDir string model string + agentType string parentID string budget float64 timeout string @@ -27,14 +28,15 @@ func newCreateCmd() *cobra.Command { Short: "Create a task via the running server", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { - return createTask(serverURL, args[0], instructions, workingDir, model, parentID, budget, timeout, priority, autoStart) + return createTask(serverURL, args[0], instructions, workingDir, model, agentType, parentID, budget, timeout, priority, autoStart) }, } - cmd.Flags().StringVar(&serverURL, "server", "http://localhost:8484", "claudomator server URL") + cmd.Flags().StringVar(&serverURL, "server", defaultServerURL, "claudomator server URL") cmd.Flags().StringVarP(&instructions, "instructions", "i", "", "task instructions (required)") cmd.Flags().StringVarP(&workingDir, "working-dir", "d", "", "working directory for the task") - cmd.Flags().StringVarP(&model, "model", "m", "", "claude model to use") + cmd.Flags().StringVarP(&model, "model", "m", "", "model to use") + cmd.Flags().StringVar(&agentType, "agent-type", "claude", "agent type: claude, gemini") cmd.Flags().StringVar(&parentID, "parent-id", "", "parent task ID (makes this a subtask)") cmd.Flags().Float64Var(&budget, "budget", 1.0, "max budget in USD") cmd.Flags().StringVar(&timeout, "timeout", "15m", "task timeout") @@ -45,12 +47,13 @@ func newCreateCmd() *cobra.Command { return cmd } -func createTask(serverURL, name, instructions, workingDir, model, parentID string, budget float64, timeout, priority string, autoStart bool) error { +func createTask(serverURL, name, instructions, workingDir, model, agentType, parentID string, budget float64, timeout, priority string, autoStart bool) error { body := map[string]interface{}{ "name": name, "timeout": timeout, "priority": priority, - "claude": map[string]interface{}{ + "agent": map[string]interface{}{ + "type": agentType, "instructions": instructions, "project_dir": workingDir, "model": model, -- cgit v1.2.3