[codex] fix(heartbeat): retain session retry issue lock - #1296
Conversation
Co-Authored-By: Paperclip <noreply@paperclip.ing>
|
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: 34d2325
Critical Issues (0)
Important Issues (0)
Suggestions (0)
Strengths
server/src/services/heartbeat.ts:14683transfers the execution lock to the scheduled session-recovery run atomically, while preserving the established release behavior for unrelated retry families.server/src/__tests__/heartbeat-retry-scheduling.test.ts:2615covers both session-unavailable retry paths and verifies the scheduled run owns the retained lock.
Recommended Action
- Merge when the required checks pass.
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: 34d2325
Critical Issues (0)
Important Issues (0)
Suggestions (0)
Strengths
server/src/services/heartbeat.ts:14683transfers the execution lock to the scheduled session-recovery run atomically, while preserving the established release behavior for unrelated retry families.server/src/__tests__/heartbeat-retry-scheduling.test.ts:2615covers both session-unavailable retry paths and verifies the scheduled run owns the retained lock.
Recommended Action
- Merge when the required checks pass.
|
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 |
|
Closing this — the diagnosis behind it doesn't hold, and #1298 fixes the same failure the other way. Full write-up in BLO-25610. Why this is the wrong direction. The premise here was "the scheduler still cleared the issue lock after creating the retry ... a second run could claim the issue during the scheduled window." A second run claiming the issue during that window is handled, and deliberately: // heartbeat.ts:1186
function issueExecutionRetryLockAvailable(currentExecutionRunId, run) {
return (
currentExecutionRunId == null ||
currentExecutionRunId === run.id ||
(run.retryOfRunId != null && currentExecutionRunId === run.retryOfRunId)
);
}
The failing expectation came from And the cost. This carve-out ("Other retry families retain their existing release-at-schedule behavior") would have two retry families hold an issue lock across an arbitrary
|
What changed
Why
Those two retry families were added to the execution-lock gate, but the scheduler still cleared the issue lock after creating the retry. A second run could claim the issue during the scheduled window.
Validation