Resume a failed run from a chosen step instead of retrying the whole task #428
Notifications
Due Date
No due date set.
Depends on
Reference: sam/archie#428
Reference in new issue
Block a user
Purpose
When a long run fails at step 7 (say, the repository gate after a 10 minute build), the only remedy today is Retry, which re-runs the whole task from step 1. An operator must be able to resume a failed run from the failed step (or a chosen earlier step), keeping the work and results of the steps before it.
Today
internal/domain/taskactions, retry modes ininternal/taskstate/taskstate.go:refresh_onto_base,continue_pushed_work). A retried attempt runs the pinned workflow from its first step.{{ steps.<id>.summary }},.result) live only in memory onTaskContext.stepResults(internal/domain/workflow/step_refs.go,step_flow.go). A resumed run would have no results for the skipped steps, so their references would render empty.continue_pushed_work); uncommitted changes from earlier steps do not.Build
StepResult(summary, structured result) with the step execution, through the State Store contract (this is a State Store SQL semantics change, so it needs a test: AGENTS.md).resume_from(a step name/position from the pinned definition). The engine skips steps before it, loading their persisted results intostepResults, and starts at it. Refuse a resume point the pinned definition does not have.continue_pushed_workand restoring the step's worktree state; the cheapest correct option is to allow resume only when earlier steps' changes were committed and pushed, and say so in the UI.Context every agent needs
ui/src/workflows/WorkflowsPage.vue,WorkflowEditor.vue) is archie-core's main operator surface: a Vue Flow canvas (WorkflowCanvas.vue, nodes inStepNode.vue, layout inworkflow-graph.ts) that both edits a workflow definition and watches its runs. Edits are edits to the YAML document (workflow-edit.ts), so the canvas and the YAML tab never disagree. ReadWORKFLOWS.md(repo root) for the workflow language.useWorkflowRuns(workflow-runs.ts):GET /api/tasksfiltered by workflow, andGET /api/tasks/{id}/attemptsfor its recorded steps (stage rows: name, status ok|failed|interrupted|running, duration_ms, error). A step is recorded under itsid, else its type. Live refresh isuseLiveResource("tasks", ...)over the SSE stream.StepEditor.vue,WorkflowSettings.vue) are the pattern for details and editing. Do not add a permanent side panel./api/**withpage.route) and look at screenshots at 1920x947 before calling it done.ui/distwith the change,task checkgates the commit, tests only for the seams AGENTS.md lists.Acceptance criteria
task checkpasses.Notes
Worktree decision: resume requires pushed work. A retry with resume_from on a task with a repository forces continue_pushed_work and is refused when the task has no pushed branch; worktree state is not restored. Resume points are stage names (step id, else type); a name two top-level steps share is refused, so the tdd commits got ids (commit-repro, commit-fix).
Close reason
Resume/re-run from a step: step results persisted per stage, retry carries resume_from, engine skips earlier steps with results loaded; canvas menu and Run panel offer it on parked runs. State Store test covers the resume read.
Imported from beads
archie-core-t19m.6· GitHub #1403 · type feature · priority P1 · created 2026-10-05 · closed 2026-10-05