feat: Recover interrupted workflow runs safely #321

Closed
opened 2026-07-13 19:46:13 +02:00 by dries · 0 comments
Owner

Parent

#311

What to build

Reconcile active runs after ocman restarts without duplicating uncertain side effects. Reconnect live agent work where possible, replay only explicitly retry-safe attempts, and pause branches that require a human decision.

Acceptance criteria

  • Startup discovers workflow attempts left in dispatching/running/canceling states and reconciles them before normal scheduling.
  • Still-live OpenCode sessions are reattached to their attempts and continue reporting state.
  • Retry-safe interrupted attempts may create a new attempt automatically under existing limits.
  • Interrupted attempts with uncertain side effects transition to unknown and dependent scheduling pauses.
  • Users can resolve unknown attempts as succeeded, failed, or eligible for retry, with an audit record.
  • Resource and workspace leases are retained, recovered, or released based on reconciled executor state.
  • No restart path dispatches two active attempts for the same node attempt slot.
  • Pause stops new scheduling while active attempts finish; cancel requests termination and marks unreachable descendants skipped.
  • Recovery and resolution states are visible and controllable from REST and the UI.
  • Tests recreate the service/database at each interruption boundary and verify no blind side-effect replay.

Blocked by

## Parent #311 ## What to build Reconcile active runs after ocman restarts without duplicating uncertain side effects. Reconnect live agent work where possible, replay only explicitly retry-safe attempts, and pause branches that require a human decision. ## Acceptance criteria - [ ] Startup discovers workflow attempts left in dispatching/running/canceling states and reconciles them before normal scheduling. - [ ] Still-live OpenCode sessions are reattached to their attempts and continue reporting state. - [ ] Retry-safe interrupted attempts may create a new attempt automatically under existing limits. - [ ] Interrupted attempts with uncertain side effects transition to unknown and dependent scheduling pauses. - [ ] Users can resolve unknown attempts as succeeded, failed, or eligible for retry, with an audit record. - [ ] Resource and workspace leases are retained, recovered, or released based on reconciled executor state. - [ ] No restart path dispatches two active attempts for the same node attempt slot. - [ ] Pause stops new scheduling while active attempts finish; cancel requests termination and marks unreachable descendants skipped. - [ ] Recovery and resolution states are visible and controllable from REST and the UI. - [ ] Tests recreate the service/database at each interruption boundary and verify no blind side-effect replay. ## Blocked by - #314 - #315 - #319 - #320
dries closed this issue 2026-07-16 00:56:09 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
dries/ocman#321
No description provided.