summaryrefslogtreecommitdiff
path: root/internal/cli/start.go
diff options
context:
space:
mode:
authorPeter Stone <thepeterstone@gmail.com>2026-03-14 00:39:22 +0000
committerPeter Stone <thepeterstone@gmail.com>2026-03-14 00:39:22 +0000
commit2ee988ccc04c09ceb6de7cdb75c94114e85d01b9 (patch)
tree29100e3e4b33748c544b9a42cb74e964df49b96e /internal/cli/start.go
parent98ccde12b08ad0b7f53e42de959a72d8382179e3 (diff)
feat: add agent selector to UI and support direct agent assignment
- Added an agent selector (Auto, Claude, Gemini) to the Start Next Task button. - Updated the backend to pass query parameters as environment variables to scripts. - Modified the executor pool to skip classification when a specific agent is requested. - Added --agent flag to claudomator start command. - Updated tests to cover the new functionality.
Diffstat (limited to 'internal/cli/start.go')
-rw-r--r--internal/cli/start.go16
1 files changed, 10 insertions, 6 deletions
diff --git a/internal/cli/start.go b/internal/cli/start.go
index 9e66e00..99af9a5 100644
--- a/internal/cli/start.go
+++ b/internal/cli/start.go
@@ -8,28 +8,32 @@ import (
"github.com/spf13/cobra"
)
-
func newStartCmd() *cobra.Command {
var serverURL string
+ var agent string
cmd := &cobra.Command{
Use: "start <task-id>",
Short: "Queue a task for execution via the running server",
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
- return startTask(serverURL, args[0])
+ return startTask(serverURL, args[0], agent)
},
}
cmd.Flags().StringVar(&serverURL, "server", "http://localhost:8484", "claudomator server URL")
+ cmd.Flags().StringVar(&agent, "agent", "", "agent to use (claude, gemini, or auto)")
return cmd
}
-func startTask(serverURL, id string) error {
- url := fmt.Sprintf("%s/api/tasks/%s/run", serverURL, url.PathEscape(id))
- resp, err := httpClient.Post(url, "application/json", nil) //nolint:noctx
+func startTask(serverURL, id, agent string) error {
+ u := fmt.Sprintf("%s/api/tasks/%s/run", serverURL, url.PathEscape(id))
+ if agent != "" {
+ u += "?agent=" + url.QueryEscape(agent)
+ }
+ resp, err := httpClient.Post(u, "application/json", nil) //nolint:noctx
if err != nil {
- return fmt.Errorf("POST %s: %w", url, err)
+ return fmt.Errorf("POST %s: %w", u, err)
}
defer resp.Body.Close()