From 0ff0bf75544bbf565288e61bb8e10c3f903830f8 Mon Sep 17 00:00:00 2001 From: Peter Stone Date: Sun, 8 Mar 2026 06:43:06 +0000 Subject: refactor: address code review notes (backward compat, Gemini tests, unknown agent test) --- internal/executor/executor_test.go | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'internal/executor/executor_test.go') diff --git a/internal/executor/executor_test.go b/internal/executor/executor_test.go index 2f205f8..9ad0617 100644 --- a/internal/executor/executor_test.go +++ b/internal/executor/executor_test.go @@ -346,3 +346,29 @@ func TestPool_ConcurrentExecution(t *testing.T) { t.Errorf("calls: want 3, got %d", runner.callCount()) } } + +func TestPool_UnsupportedAgent(t *testing.T) { + store := testStore(t) + runners := map[string]Runner{"claude": &mockRunner{}} + logger := slog.New(slog.NewTextHandler(os.Stderr, &slog.HandlerOptions{Level: slog.LevelError})) + pool := NewPool(2, runners, store, logger) + + tk := makeTask("bad-agent") + tk.Agent.Type = "super-ai" + store.CreateTask(tk) + + if err := pool.Submit(context.Background(), tk); err != nil { + t.Fatalf("submit: %v", err) + } + + result := <-pool.Results() + if result.Err == nil { + t.Fatal("expected error for unsupported agent") + } + if !strings.Contains(result.Err.Error(), "unsupported agent type") { + t.Errorf("expected 'unsupported agent type' in error, got: %v", result.Err) + } + if result.Execution.Status != "FAILED" { + t.Errorf("status: want FAILED, got %q", result.Execution.Status) + } +} -- cgit v1.2.3