summaryrefslogtreecommitdiff
path: root/internal/task/task_test.go
diff options
context:
space:
mode:
authorPeter Stone <thepeterstone@gmail.com>2026-03-14 00:33:46 +0000
committerPeter Stone <thepeterstone@gmail.com>2026-03-14 00:33:46 +0000
commit6ac15be438e3692cbc2ae2f36ab2d69468fc6372 (patch)
treef0fded632c7ade09ed4232a4ac0dd90bce795a31 /internal/task/task_test.go
parente2656fcaaed85028785822493a93c7be50dd44c2 (diff)
fix: cancel blocked tasks + auto-complete completion reports
Two fixes for BLOCKED task issues: 1. Allow BLOCKED → CANCELLED state transition so users can cancel tasks stuck waiting for input. Adds Cancel button to BLOCKED task cards in the UI alongside the question/answer controls. 2. Detect when agents write completion reports to $CLAUDOMATOR_QUESTION_FILE instead of real questions. If the question JSON has no options and no "?" in the text, treat it as a summary (stored on the execution) and fall through to normal completion + sandbox teardown rather than blocking. Also tightened the preamble to make the distinction explicit. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'internal/task/task_test.go')
-rw-r--r--internal/task/task_test.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/internal/task/task_test.go b/internal/task/task_test.go
index 9873084..15ba019 100644
--- a/internal/task/task_test.go
+++ b/internal/task/task_test.go
@@ -25,6 +25,7 @@ func TestValidTransition_AllowedTransitions(t *testing.T) {
{"running to blocked (question)", StateRunning, StateBlocked},
{"blocked to queued (answer resume)", StateBlocked, StateQueued},
{"blocked to ready (parent unblocked by subtasks)", StateBlocked, StateReady},
+ {"blocked to cancelled (user cancels)", StateBlocked, StateCancelled},
{"budget exceeded to queued (retry)", StateBudgetExceeded, StateQueued},
{"cancelled to queued (restart)", StateCancelled, StateQueued},
}