fix(work-loop): open a PR for work recovered from a prior run (crash recovery)#84
Conversation
…recovery) Completes #77. With branch reuse on resume (Part A), a group whose earlier tasks were committed by a prior run but never opened a PR — because the run crashed, or a remaining task blocks on resume — now recovers that committed work into a PR instead of stranding it as blocked. recoveredDelivery() synthesizes a delivery from the group's already-`done` tasks (a reliable proxy for committed, since a task is only marked done after its commit is finalized) anchored on the group branch + title; work() uses it on both block paths when no PR exists. A genuinely fresh run whose first task blocks (nothing done) still blocks. Closes #77
|
Important Review skippedNo new commits to review since the last review. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 Walkthrough>WorkLoop: blocked resultelse worker returns null delivery |
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
Summary
Completes the crash-recovery story started in #77 (Part A reused the branch on resume so prior commits persist). A group whose earlier tasks were committed by a prior run but never opened a PR — the run crashed, or a remaining task blocks on resume — now recovers that committed work into a PR instead of stranding it as
blocked.Changes
src/loop/work-loop.ts— newrecoveredDelivery(group)(exported for tests): synthesizes a delivery from the group's already-donetasks (a reliable "committed" proxy — a task is marked done only after its commit is finalized), anchored on the group branch + title.work()uses it on both block paths when no PR exists. A fresh run whose first task blocks (nothing done) still blocks.Testing
src/loop/work-loop.test.ts: resume-with-all-done → recovers a PR; resume-with-a-blocked-task-after-a-committed-one → recovers a PR; fresh-first-task-blocked → still blocks;recoveredDeliveryunit cases.bun test+node --testgreen (42 file / 683 suite);biome+tscclean.Closes #77
Summary by CodeRabbit
New Features
Bug Fixes