Skip to content

Crash recovery must close a mid-retry workflow work-log line #824

Closed

Description

@currentbits

Decision

A workflow that dies mid-retry must fail closed on the next process start. Do not leave Plan agent 1 retrying (or any other in-progress work-log item) at done:false forever.

Slice of #182. Follow-up to #823 (in-progress retry line during a live same-process retry). If the app crashes during that second spawn, boot recovery must finish the line.

Steps

  • Failing tests: mid-retry done:false becomes done:true on Store load; sibling in-progress phase line also closes; idle work-log untouched; already-done items stay done; healed line survives a second load
  • recoverInterruptedRuns completes in-progress work-log items on recovered working threads (mutate data.workLogByThread in place — store.data is not assigned yet)
  • Persist via the existing _recoveredOnLoad save; do not JSON.parse transcripts (Crash recovery hydrates working-thread transcripts at boot (#639 leftover) #643)

Activity

  1. added
    plan:doing
    plan:done
    and removed
    plan:doing
    on Sep 2, 2026
  2. currentbits commented on Sep 2, 2026

    @currentbits
    OwnerAuthor

    Done

    recoverInterruptedRuns now fail-closes in-progress work-log items on recovered working threads.

    • Same item / label / id; only done flips to true
    • Sibling open phase lines close too (no leftover done:false)
    • Idle threads and already-done items untouched
    • Mutates data.workLogByThread in place (store.data is not assigned yet during _readFile)
    • Persist via existing _recoveredOnLoad save
    • Does not JSON.parse transcripts (Crash recovery hydrates working-thread transcripts at boot (#639 leftover) #643)

    Tests: electron/test/workflow-crash-resume.test.js (also on the Windows electron list).

    Verified

    • New suite: 4/4
    • electron/test/store.test.js + new suite: 87/87

    Not in this slice: re-spawn the second CLI, --resume (#815), resume-from-phase-N (rest of #182), Retry button. Kimi flags unchanged. Nothing committed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    plan:done

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions