Repository navigation
fix(actions): keep prepared review alive across lease handoff - #120
Conversation
|
Reviewed head This is a valuable recovery fix, but the new Please base proposal cleanup on the durable task's actual pause/cancel state or an explicit abort reason, rather than the signal alone. Add a regression through the real worker heartbeat: lose the lease while preparing a proposal, observe an aborted signal, and assert the proposal survives for the replacement worker; keep the real pause/cancel denial case. The current new tests manufacture lease loss with an un-aborted signal and do not cover that path. Current GitHub checks pass, but this is a static finding in the proposed cleanup condition; I did not rerun tests. Changed code: apps/server/src/engine/service.ts:717. |
|
Addressed jerelvelarde's lease-heartbeat counterexample in The cleanup decision no longer uses The regression now exercises the exact distinction:
This keeps heartbeat/worker-stop aborts recoverable without weakening explicit user stop semantics. CI for the new head is queued/running or reported below; I have not claimed a local run. |
jerelvelarde
left a comment
There was a problem hiding this comment.
No blocking findings. Checking the persisted task status correctly distinguishes a lease takeover from a user pause/cancel, even when both abort the old worker's signal. A takeover retains one deterministic proposal for the successor; durably paused/cancelled tasks still clean up the orphaned review. Existing action ownership, hashes, account binding, and execution checks are preserved. This is a focused reliability fix appropriate for the template.
Validation: all 30 prepare-lease-loss/action/workflow/engine tests pass locally, including takeover with an already aborted signal and both pause/cancel cases. Root TypeScript and changed-file Biome checks pass. All seven GitHub checks pass. No live provider writes were performed.
Minor documentation note: the description still says cleanup is based on the abort signal; the final implementation correctly uses durable task status. Please update that explanation.
Problem
AgentService.prepare()auto-denies anawaiting_reviewproposal when checkpointingactionIdfails.That cleanup is correct for a durable pause/cancel, but lease loss can abort the same worker signal. Treating the signal itself as proof of user cancellation can therefore destroy a proposal the replacement worker needs to recover.
Change
Base proposal cleanup on the persisted task status, not the abort signal alone.
On lease takeover:
awaiting_review;On durable pause/cancel:
Tests
Focused regressions cover:
Verification
Reviewer verification by @jerelvelarde:
Integration limits
No live provider writes were performed. This changes only recovery/cleanup classification; review schema, proposal keys, and approval execution semantics are unchanged.