fix(recovery): an agent step a restart interrupted continues where it stopped (#70) #72

Merged
cmoriarty merged 1 commit from worktree-restart-continues-in-place into main 2026-09-27 01:06:23 -04:00
Owner

Closes #70.

Why. An osfd restart threw away every running agent step's work. On 2026-09-26 at 23:11 a deploy restarted osfd 15 minutes into openspec.apply[1] of run_01M3GB3KN38YT9TZJ7KA7RQ5M0. Recovery saw the session gone (opencode dies with the container), found resume_safe: false, and ruled rollback_retry, so attempt 2 started from attempt 1's entry tree (105ce4f8d9).

What.

  • "Died mid-turn" is now resume for every agent step. resume and reprompt put continue: true on the ready event, so the next attempt keeps the worktree and is seeded with the last handoff and git status/git diff. That is #60's run-resume machinery, reused unchanged.
  • A recovery gate answered Resume continues the same way.
  • These still roll back: a wedged session, a stall redo, Redo from entry, and scripted steps.
  • resume_safe is retired, since it no longer decides anything. The built-in pipelines and the generated apply chain drop it. The loader no longer requires it, and ignores it where an existing .osf/pipeline.yaml still writes it. rollback_retry stays readable for old logs.
  • tools/test.sh: the full lane with OSF_URL died on macOS bash 3.2 at the browser step, because of an empty array under set -u.

Tests.

  • A restart mid-edit continues in place with its handoff, and a stall redo still rolls back. With the continuation disabled, the first of these fails as (2, False, False, '').
  • Which verdicts continue, by step kind.
  • Resume and Redo from entry on a recovery gate.
  • The loader still accepts an old resume_safe.

Lanes.

  • Fast lane: green.
  • Full lane: backend 1,799, UI unit 416 and 81 browser specs pass. The two @live follow-the-tail specs failed against a stale local osfd serving its own UI, so they don't test this branch.

Spec: openspec/changes/restart-continues-in-place.

🤖 Generated with Claude Code

Closes #70. **Why.** An osfd restart threw away every running agent step's work. On 2026-09-26 at 23:11 a deploy restarted osfd 15 minutes into `openspec.apply[1]` of `run_01M3GB3KN38YT9TZJ7KA7RQ5M0`. Recovery saw the session gone (opencode dies with the container), found `resume_safe: false`, and ruled `rollback_retry`, so attempt 2 started from attempt 1's entry tree (`105ce4f8d9`). **What.** - "Died mid-turn" is now `resume` for every agent step. `resume` and `reprompt` put `continue: true` on the ready event, so the next attempt keeps the worktree and is seeded with the last handoff and `git status`/`git diff`. That is #60's run-resume machinery, reused unchanged. - A recovery gate answered **Resume** continues the same way. - These still roll back: a wedged session, a stall redo, **Redo from entry**, and scripted steps. - `resume_safe` is retired, since it no longer decides anything. The built-in pipelines and the generated apply chain drop it. The loader no longer requires it, and ignores it where an existing `.osf/pipeline.yaml` still writes it. `rollback_retry` stays readable for old logs. - `tools/test.sh`: the full lane with `OSF_URL` died on macOS bash 3.2 at the browser step, because of an empty array under `set -u`. **Tests.** - A restart mid-edit continues in place with its handoff, and a stall redo still rolls back. With the continuation disabled, the first of these fails as `(2, False, False, '')`. - Which verdicts continue, by step kind. - Resume and Redo from entry on a recovery gate. - The loader still accepts an old `resume_safe`. **Lanes.** - Fast lane: green. - Full lane: backend 1,799, UI unit 416 and 81 browser specs pass. The two `@live` follow-the-tail specs failed against a stale local osfd serving its own UI, so they don't test this branch. Spec: `openspec/changes/restart-continues-in-place`. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
fix(recovery): an agent step a restart interrupted continues where it stopped (#70)
Some checks failed
deploy / deploy (push) Failing after 35m8s
850dbab5f5
A deploy restarted osfd 15 minutes into openspec.apply[1] of
run_01M3GB3KN38YT9TZJ7KA7RQ5M0. Recovery saw the session gone (opencode dies
with the container), found resume_safe: false, ruled rollback_retry, and
attempt 2 started from attempt 1's entry tree.

- "Died mid-turn" is now resume for every agent step. resume and reprompt
  carry continue: true, so the next attempt keeps the worktree and is seeded
  with the last handoff and git status/diff, as a run-resume is (#60).
- A recovery gate answered Resume continues the same way. A wedged session,
  a stall redo, Redo from entry and scripted steps still roll back.
- resume_safe is retired. Nothing reads it now, so the built-in pipelines and
  the generated apply chain drop it, and the loader no longer requires it and
  ignores it where an older document still writes it. rollback_retry stays
  readable for old logs.
- tools/test.sh: the full lane with OSF_URL died on macOS bash 3.2 at the
  browser step (empty array under set -u).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign in to join this conversation.
No reviewers
No labels
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
cmoriarty/braid!72
No description provided.