summaryrefslogtreecommitdiff
path: root/internal/api/server.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/api/server.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/api/server.go')
-rw-r--r--internal/api/server.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/internal/api/server.go b/internal/api/server.go
index df35536..163f2b8 100644
--- a/internal/api/server.go
+++ b/internal/api/server.go
@@ -488,9 +488,10 @@ func (s *Server) handleGetTask(w http.ResponseWriter, r *http.Request) {
}
writeJSON(w, http.StatusOK, t)
}
-
func (s *Server) handleRunTask(w http.ResponseWriter, r *http.Request) {
id := r.PathValue("id")
+ agent := r.URL.Query().Get("agent")
+
t, err := s.store.ResetTaskForRetry(id)
if err != nil {
if strings.Contains(err.Error(), "not found") {
@@ -505,6 +506,10 @@ func (s *Server) handleRunTask(w http.ResponseWriter, r *http.Request) {
return
}
+ if agent != "" && agent != "auto" {
+ t.Agent.Type = agent
+ }
+
if err := s.pool.Submit(context.Background(), t); err != nil {
writeJSON(w, http.StatusServiceUnavailable, map[string]string{"error": fmt.Sprintf("executor pool: %v", err)})
return