summaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
Diffstat (limited to 'internal')
-rw-r--r--internal/task/task.go2
-rw-r--r--internal/task/task_test.go1
2 files changed, 2 insertions, 1 deletions
diff --git a/internal/task/task.go b/internal/task/task.go
index 6b240dd..8bb3214 100644
--- a/internal/task/task.go
+++ b/internal/task/task.go
@@ -123,7 +123,7 @@ func ValidTransition(from, to State) bool {
StateFailed: {StateQueued}, // retry
StateTimedOut: {StateQueued}, // retry
StateCancelled: {StateQueued}, // restart
- StateBlocked: {StateQueued}, // answer received → re-queue as resume execution
+ StateBlocked: {StateQueued, StateReady}, // answer received → re-queue as resume execution
}
for _, allowed := range transitions[from] {
if allowed == to {
diff --git a/internal/task/task_test.go b/internal/task/task_test.go
index 5d997ac..5cb12d0 100644
--- a/internal/task/task_test.go
+++ b/internal/task/task_test.go
@@ -24,6 +24,7 @@ func TestValidTransition_AllowedTransitions(t *testing.T) {
{"timed out to queued (retry)", StateTimedOut, StateQueued},
{"running to blocked (question)", StateRunning, StateBlocked},
{"blocked to queued (answer resume)", StateBlocked, StateQueued},
+ {"blocked to ready (parent unblocked by subtasks)", StateBlocked, StateReady},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {