summaryrefslogtreecommitdiff
path: root/internal/task/task.go
diff options
context:
space:
mode:
authorPeter Stone <thepeterstone@gmail.com>2026-03-09 01:11:05 +0000
committerPeter Stone <thepeterstone@gmail.com>2026-03-09 01:11:05 +0000
commit1b4be14d02d3fd17beeddcce8d5056d51b19296c (patch)
treee07b83c4540cf094dcaee6f98e1ca3b7f574c32f /internal/task/task.go
parent5ad8356b5ce4d525af079f902791559d53b67bba (diff)
task: allow requeueing BUDGET_EXCEEDED tasks
Permitted BUDGET_EXCEEDED -> QUEUED transition in ValidTransition. Updated frontend to show 'Restart' button for BUDGET_EXCEEDED tasks, allowing them to be requeued after failure.
Diffstat (limited to 'internal/task/task.go')
-rw-r--r--internal/task/task.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/internal/task/task.go b/internal/task/task.go
index 8bb3214..447c4a3 100644
--- a/internal/task/task.go
+++ b/internal/task/task.go
@@ -121,9 +121,10 @@ func ValidTransition(from, to State) bool {
StateRunning: {StateReady, StateCompleted, StateFailed, StateTimedOut, StateCancelled, StateBudgetExceeded, StateBlocked},
StateReady: {StateCompleted, StatePending},
StateFailed: {StateQueued}, // retry
- StateTimedOut: {StateQueued}, // retry
- StateCancelled: {StateQueued}, // restart
- StateBlocked: {StateQueued, StateReady}, // answer received → re-queue as resume execution
+ StateTimedOut: {StateQueued}, // retry
+ StateCancelled: {StateQueued}, // restart
+ StateBudgetExceeded: {StateQueued}, // retry
+ StateBlocked: {StateQueued, StateReady}, // answer received → re-queue as resume execution
}
for _, allowed := range transitions[from] {
if allowed == to {