fix(nodetask): stop re-submitting gov/sidecar tasks every poll#450
Conversation
The nodetask controller never advanced status.task.status off Pending, so the == TaskPending submit guard re-invoked SubmitTask on every 15s poll for the task's whole life. Deterministic task IDs make that idempotent only while the sidecar retains the task; if its store is lost the next poll re-submits — a double-submit / double-deposit hazard for non-idempotent gov proposals. Add a TaskRunning enum value and set it after a successful submit so later reconciles poll instead of re-submitting. Terminal transitions are unchanged (the status switch overwrites unconditionally). By design (resolved for PR 2b): a submit whose status flush then fails still re-submits once on requeue (pre-existing, now the only window); and after this fix a sidecar store-loss parks the task in Running rather than resubmitting — safer for non-idempotent proposals, resolved by 2b's inclusion re-check. Reviewed: idiomatic-reviewer, systems-engineer. Design: bdchatham-designs#98. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
PR SummaryMedium Risk Overview Adds Adds a regression test that asserts one submit and continued status polls without re-submit. Reviewed by Cursor Bugbot for commit bb2d2f8. Bugbot is set up for automated code reviews on this repo. Configure here. |
What
The nodetask controller never advanced
status.task.statusoffPending, so the== TaskPendingsubmit guard re-invokedSubmitTaskon every 15s poll for a task's whole life. Deterministic task IDs make that idempotent only while the sidecar retains the task; if its store is lost, the next poll re-submits — a double-submit / double-deposit hazard for non-idempotent gov proposals (GovSoftwareUpgrade/GovParamChange).Change
TaskRunningvalue to theTaskStatusenum (additive; the SeiNode plan executor never writes it).TaskRunningafter a successfulExecute, so later reconciles poll instead of re-submitting.By-design notes (resolved for PR 2b)
Runningrather than resubmitting — the safer behavior for non-idempotent proposals; PR 2b's inclusion re-check resolves it.Standalone bug fix — no seictl dependency. First slice of the SeiNodeTask gov UX work.
Reviewed: idiomatic-reviewer, systems-engineer (correct, ship it). Design: sei-protocol/bdchatham-designs#98.
🤖 Generated with Claude Code