[codex] fix(issues): restore checkout status across ownership releases (BLO-20649) - #1258
Conversation
|
🔗 Paperclip issue: BLO-20649 |
1 similar comment
|
🔗 Paperclip issue: BLO-20649 |
|
Hey @kkroo! Before this PR can be reviewed, a few things need attention: Missing or incomplete:
Once updated, push a new commit and these checks will re-run automatically. — commitperclip |
8565f60 to
98bc7c9
Compare
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
There was a problem hiding this comment.
Ally — Consolidated PR Review
Lenses: pr-review-toolkit (code, tests, comments, errors, types) + gstack/review + native-codex.
Reviewed head: 98bc7c9
Critical Issues (0)
Important Issues (2)
- [gstack/review, native-codex]
server/src/services/heartbeat.ts:16996— Successful runs that carry onlytaskIdare restored before their handoff is queued. The restore deferral usesreadRuntimeStatusIssueIdCandidate, which does not seetaskId, whilehandleSuccessfulRunHandoffexplicitly accepts it at line 11945. The resulting handoff wake targets a restoredtodoissue and can fail itsin_progressdispatch-staleness check. The same sequence exists atserver/src/services/heartbeat.ts:23769.
Recommendation: derive the deferred primary issue from the sameissueId ?? taskIdsource used by the handoff path, and add a taskId-only regression test. - [pr-review-toolkit, native-codex]
server/src/services/heartbeat.ts:15726— The newly added restore call demotes the issue but leavescheckoutRunIdpointing to the terminal run. This path clears only execution-lock fields;restoreCheckoutPromotedStatuspermits restoration once the remaining checkout owner is terminal, but checkout requires the incoming run to match or replace a nullcheckoutRunId(server/src/services/issues.ts:9833). The restoredtodo/backlogissue therefore remains unclaimable. The stale-queued path repeats this atserver/src/services/heartbeat.ts:15964, as does watchdog finalization atserver/src/services/recovery/service.ts:2925.
Recommendation: clear the matchingcheckoutRunIdatomically before restoring, or route these paths through the shared full lock-release helper; cover each cancellation/fold path.
Suggestions (0)
Strengths
- The marker-based design preserves an explicit status disposition and correctly protects rows still owned by a live retry.
- The new tests cover normal round trips, stale-lock adoption, sibling cleanup, and continuation dispatch.
Recommended Action
- Fix the Important issues before merge.
…0649) Co-Authored-By: Paperclip <noreply@paperclip.ing>
98bc7c9 to
3efd202
Compare
There was a problem hiding this comment.
Ally — Consolidated PR Review
Lenses: pr-review-toolkit (code, tests, comments, errors, types) + gstack/review + native-codex.
Reviewed head: 3efd202
Prior Findings Dispositioned (2)
- prior:98bc7c9 important 1 — fixed —
server/src/services/heartbeat.ts:18757—issueIdFromRunContextnow resolvesissueId ?? taskId, and both finalization paths defer restoration using that helper before queuing the successful handoff. - prior:98bc7c9 important 2 — fixed —
server/src/services/issue-checkout-status.ts:16— terminal paths use per-column ownership release to clear a matchingcheckoutRunIdbefore guarded status restoration; the dependency, stale-queue, and watchdog paths are covered.
Critical Issues (0)
Important Issues (0)
Suggestions (0)
Strengths
- The shared restoration guard preserves a newer live retry owner while safely returning abandoned checkout promotions to their original status.
- Regression coverage exercises taskId-only handoff, cancellation/fold cleanup, and finalizer continuation dispatch.
Recommended Action
- Merge when the remaining required checks and approvals are satisfied.
allyblockcast
left a comment
There was a problem hiding this comment.
Ally — Consolidated PR Review
Lenses: pr-review-toolkit (code, tests, comments, errors, types) + gstack/review + native-codex.
Reviewed head: 3efd202
Prior Findings Dispositioned (2)
- prior:98bc7c9 important 1 — fixed —
server/src/services/heartbeat.ts:18757—issueIdFromRunContextnow resolvesissueId ?? taskId, and both finalization paths defer restoration using that helper before queuing the successful handoff. - prior:98bc7c9 important 2 — fixed —
server/src/services/issue-checkout-status.ts:16— terminal paths use per-column ownership release to clear a matchingcheckoutRunIdbefore guarded status restoration; the dependency, stale-queue, and watchdog paths are covered.
Critical Issues (0)
Important Issues (0)
Suggestions (0)
Strengths
- The shared restoration guard preserves a newer live retry owner while safely returning abandoned checkout promotions to their original status.
- Regression coverage exercises taskId-only handoff, cancellation/fold cleanup, and finalizer continuation dispatch.
Recommended Action
- Merge when the remaining required checks and approvals are satisfied.
There was a problem hiding this comment.
Ally — Consolidated PR Review
Lenses: pr-review-toolkit (code, tests, comments, errors, types) + gstack/review + native-codex.
Reviewed head: 59c359c
Critical Issues (0)
Important Issues (0)
Suggestions (0)
Strengths
- The exact-head regression now verifies the production cleanup sequence: a terminal adopter releases both ownership columns, restores the captured
todotier, and lets assigned-todo liveness enqueueissue_assignedwithout changing the assignee. - The full restoration implementation guards against live replacement runs and clears the marker only when the queue-tier restoration is actually safe.
- The narrow follow-up changes the expected recovery contract without weakening production behavior.
Recommended Action
- Merge when the remaining required checks and approvals are satisfied.
allyblockcast
left a comment
There was a problem hiding this comment.
Ally — Consolidated PR Review
Lenses: pr-review-toolkit (code, tests, comments, errors, types) + gstack/review + native-codex.
Reviewed head: 59c359c
Critical Issues (0)
Important Issues (0)
Suggestions (0)
Strengths
- The exact-head regression now verifies the production cleanup sequence: a terminal adopter releases both ownership columns, restores the captured
todotier, and lets assigned-todo liveness enqueueissue_assignedwithout changing the assignee. - The full restoration implementation guards against live replacement runs and clears the marker only when the queue-tier restoration is actually safe.
- The narrow follow-up changes the expected recovery contract without weakening production behavior.
Recommended Action
- Merge when the remaining required checks and approvals are satisfied.
Thinking Path
Linked Issues or Issue Description
What Changed
Verification
Risks
Model Used
Checklist