summaryrefslogtreecommitdiff
path: root/internal/api/server_test.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_test.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_test.go')
-rw-r--r--internal/api/server_test.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/internal/api/server_test.go b/internal/api/server_test.go
index c90e3b3..2209a69 100644
--- a/internal/api/server_test.go
+++ b/internal/api/server_test.go
@@ -384,6 +384,23 @@ func TestRunTask_TimedOutTask_Returns202(t *testing.T) {
}
}
+func TestRunTask_WithAgentParam(t *testing.T) {
+ srv, store := testServer(t)
+ createTaskWithState(t, store, "run-agent-param", task.StatePending)
+
+ // Request run with agent=gemini.
+ req := httptest.NewRequest("POST", "/api/tasks/run-agent-param/run?agent=gemini", nil)
+ w := httptest.NewRecorder()
+ srv.Handler().ServeHTTP(w, req)
+
+ if w.Code != http.StatusAccepted {
+ t.Fatalf("status: want 202, got %d; body: %s", w.Code, w.Body.String())
+ }
+
+ // Wait for the task to complete via the mock runner.
+ pollState(t, store, "run-agent-param", task.StateReady, 2*time.Second)
+}
+
func TestRunTask_CompletedTask_Returns409(t *testing.T) {
srv, store := testServer(t)
createTaskWithState(t, store, "run-completed", task.StateCompleted)