Release cancelled review leases on force - #582
Open
prathamdby wants to merge 2 commits into
Open
Conversation
- Add a slash force case that holds a review lease then expects the replacement to acquire and claim
- Clear cancelled review lease holders during intake so a force replacement can acquire and claim immediately - Document intake lease clear on force, cancel, and close
Contributor
PR Agent ReviewNote The orchestrated review completed.
4d5d35f ⋅ general ⋅ 43m 47s ⋅ glm-5.3 |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
prathamdby
marked this pull request as ready for review
September 8, 2026 14:11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
cancelActiveReviewsstill marks queued and running review rowscancelled.releasePrActorLeaseHeldByWorkItemswith those row ids.releasePrActorLeaseHeldByWorkItemsinsrc/agentWork/prActorLease.tsclearswork_item_idandholder_idon matchingpr_actor_leasesrows for thatresource_keyandwork_type./review forceuses that cancel path, so the replacement can acquire the lease in the same intake transaction./canceland pull-request close cancel use the same clear.CONTEXT.md, ADR 0030,docs/operations.md, anddocs/agent-work-ops.mdrecord the holder clear.Details
Cancel clears the holder
cancelActiveReviewsinsrc/agentWork/intake/workItemRepository.tsmaps cancelled rows, then releases any lease those ids still hold.sequenceDiagram participant Slash participant Cancel participant Lease participant Replacement Slash->>Cancel: /review force Cancel->>Cancel: status cancelled Cancel->>Lease: clear holder for cancelled ids Slash->>Replacement: create queued review Replacement->>Lease: acquireDocs
CONTEXT, ADR 0030 decision 5, operations
/cancel/review forceclose cancel, and agent-work-ops name the holder clear.PR Agent Description
PR Type
Enhancement, Tests, Documentation
Description
cancelActiveReviewsnow clears thepr_actor_leasesholder for every cancelled review row, inside the same intake transaction.releasePrActorLeaseHeldByWorkItemsmatches onwork_item_idwithin one resource key and work type, so it cannot clear another holder's lease./review forcepreviously waited for the running worker to exit or forPR_ACTOR_LEASE_TTL_SECONDSbefore the replacement could acquire.heldEpoch + 1and then claims.cancelActiveTriagekeeps the cooperative exit plus TTL path for triage work.reviewCloseCancelexpects three queries and asserts the new SQL parameters;slashIntakemocks stub the addedpr_actor_leasesquery.CONTEXT.md, ADR 0030,agent-work-ops.md, andoperations.mdto describe the immediate lease handoff for/cancel,/review force, and close cancel.Changes Diagram
Review map
src/agentWork/prActorLease.ts: New id-based lease release; verify the match cannot clear a live holdersrc/agentWork/intake/workItemRepository.ts: Cancel wiring; confirm the clear runs in the intake transactiontest/integration/slashActiveUniqueness.integration.test.ts: End-to-end proof that a force replacement acquires the next epochtest/reviewCloseCancel.test.ts: Unit contract for the new SQL call, parameters, and query countdocs/adr/0030-pr-actor-lease.md: Recorded design decision; check scope wording against behaviour