diff options
| author | Peter Stone <thepeterstone@gmail.com> | 2026-03-09 07:11:57 +0000 |
|---|---|---|
| committer | Peter Stone <thepeterstone@gmail.com> | 2026-03-10 09:29:02 +0000 |
| commit | 0676f0f2e6d1ba371806ca4b808a4993027d86ea (patch) | |
| tree | c8d6776d1b4f1b82e3ba2b392272f359fb0ca499 /internal/api/server_test.go | |
| parent | a62a19bbf774289e2018e50454aa719c1a2a9070 (diff) | |
fix: ensure tasks are re-classified on manual restart
Updated handleRunTask to use ResetTaskForRetry, which clears the agent type and model. This ensures that manually restarted tasks are always re-classified, allowing the system to switch to a different agent if the previous one is rate-limited. Also improved Claude quota-exhaustion detection.
Diffstat (limited to 'internal/api/server_test.go')
| -rw-r--r-- | internal/api/server_test.go | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/internal/api/server_test.go b/internal/api/server_test.go index 9b5c7ae..afdc9d2 100644 --- a/internal/api/server_test.go +++ b/internal/api/server_test.go @@ -397,9 +397,8 @@ func TestRunTask_CompletedTask_Returns409(t *testing.T) { } var body map[string]string json.NewDecoder(w.Body).Decode(&body) - wantMsg := "task cannot be queued from state COMPLETED" - if body["error"] != wantMsg { - t.Errorf("error body: want %q, got %q", wantMsg, body["error"]) + if !strings.Contains(body["error"], "invalid state transition") { + t.Errorf("error body: want it to contain 'invalid state transition', got %q", body["error"]) } } |
