You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Task remains wedged after host verification failure: successor Attempt inherits exhausted timeout-recovery state and settles as lifecycle-progression #3154
The recovery blocker said: idle recovery exhausted 2 attempts. Status: DB task status is not closed.
Reproduction sequence
An execute-task Attempt starts.
Initial host verification fails.
Recovery is created; the Task is retried.
A successor Attempt is claimed after an earlier run exhausted idle recovery.
On its first idle timeout, the successor is immediately treated as recovery-exhausted.
The unit is advanced without an executor result, so the Attempt settles failed / lifecycle-progression.
Recovery routes a terminal abort.
No running Attempt remains; gsd_task_complete correctly refuses completion.
Re-entering /gsd auto repeats the same abort path.
Root cause
Timeout-recovery state was stored per unit, not per Attempt.
Dispatch-time writeUnitRuntimeRecord() passed timeoutAt: null and a recovery count from resolveDispatchRecoveryAttempts(), but the merge used nullish coalescing:
null for timeoutAt did not clear the previous run's value.
undefined for recoveryAttempts fell back to the previous run's exhausted count.
recoverTimedOutUnit() then used runtime.recoveryAttempts as the exhaustion counter instead of the budget on the current dispatch row.
Evidence from the affected database:
A successor Attempt started at 22:43.
Its runtime record still had timeout_at around 22:01 and recovery_attempts: 7.
Its first idle recovery was immediately considered exhausted and ended the unit without a result.
This turns a stale runtime counter into a terminal lifecycle-progression failure, an agent-owned abort, and a Task with no running Attempt.
Expected behavior
Every newly dispatched Attempt must start with a fresh per-dispatch timeout-recovery budget.
Recovery resume must claim exactly one authorized successor Attempt.
Fresh host verification must run, produce a passing Technical Verdict, and publish the completion.
If recovery is genuinely exhausted, completion must stay fail-closed; the running-Attempt requirement must not be removed.
Additional note
The task-plan Verify command also contains dependency-gated @export scenarios. That is a separate verify-contract/environment issue. The lifecycle defect above is what makes the Task unwedgeable even after the environment is restored.
Fix
A fix is prepared in metacoma/gsd-pi on branch fix/task-recovery-lifecycle-deadlock (commit bc1abf6d):
Reset run-scoped runtime timeout/recovery state when a new Attempt starts.
Derive recovery exhaustion from the dispatch-row budget when a dispatch exists.
Keep the runtime record as fallback only for units without a dispatch row.
Regression coverage: before the fix 0/3 regression tests pass; after the fix 3/3 pass.
Activity