feat: implement issue #1660 — Action budget, slice 3a: checkpoint-push partial work before the budget expires - #1709
Conversation
…h partial work before the budget expires
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
ⓘ Qodo reviews are paused because your trial has ended. Ask your workspace admin to add credits to resume reviews. Manage billing |
🤖 CodeAnt AI — Review Status
|
Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
Dev-Lead — waiting on PR blockers (intent: review-changes)PR: #1709 |
|
Note @don-petry I reviewed this PR and no code changes were needed, but it still has blocking checks or reviews (failing or cancelled checks, or changes-requested reviews), so I cannot mark it done yet. I'll re-check automatically. |
There was a problem hiding this comment.
Code Review
This pull request implements a checkpoint-push mechanism in scripts/dev-lead-fix-issue.sh to preserve partial work on stage timeouts (exit 124) by committing changes under an incomplete marker and pushing the branch. It also updates the corresponding unit tests in tests/dev-lead/unit/test_fix_issue.bats. The review feedback recommends using $BATS_TEST_TMPDIR in the BATS tests instead of manually creating and cleaning up temporary files with mktemp and rm, which ensures automatic per-test isolation and cleanup on failure.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Team Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. Important Approval pendingCodeRabbit has no unresolved comments, but it has not reviewed the latest commit. Use the checkbox below to review the latest commit. CodeRabbit will approve the changes if it finds no blocking issues.
📝 WalkthroughWalkthroughOn stage timeout, the engine now commits and pushes partial work with an incomplete marker. Escalation comments name successful checkpoint branches or retain the unrecoverable note after push failure. Tests verify timeout, completion-gate, failure, and normal-run behavior. ChangesTimeout checkpoint flow
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to Timed-out work is now saved as an explicitly incomplete checkpoint and reported for human follow-up, while normal successful runs retain their existing completion behavior. No actionable merge-blocking risk remains. Sequence Diagram(s)sequenceDiagram
participant handle_engine_failure
participant checkpoint_push_partial_work
participant GitRemote
participant IssueComment
handle_engine_failure->>checkpoint_push_partial_work: checkpoint partial work
checkpoint_push_partial_work->>GitRemote: commit and push branch
GitRemote-->>checkpoint_push_partial_work: branch name or push failure
checkpoint_push_partial_work-->>handle_engine_failure: checkpoint result
handle_engine_failure->>IssueComment: post timeout escalation
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Description checkExplanation The description explains the implementation and impact, but it does not follow the repository template. It omits the required Summary heading, Interaction contract section, and checklist confirmations. Resolution Update the description to use the repository template. Add the Summary section, mark the Interaction contract as N/A or complete the required agentic-role contract details, and confirm the shellcheck and documentation checklist items. Remove unrelated generated usage content if it is not needed. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
CodeAnt Nitpicks1 code suggestion1. Any different
|
|
CI checks on this PR are still running. Once they complete, re-mention Posted by the donpetry-bot PR-review cascade. |
Dev-Lead — fix-reviews (applied)Changes committed and pushed. |
donpetry-bot
left a comment
There was a problem hiding this comment.
Automated review — APPROVED ✓
Risk: MEDIUM
Reviewed commit: e8f81715834a07998ab672d0964c156e42aaa61a
Review mode: triage-approved (single reviewer)
Summary
Confirms the triage assessment: a focused, well-tested change to the dev-lead timeout path that checkpoint-pushes partial work (issue #1660, slice 3a). Adds checkpoint_push_partial_work() invoked only from the exit-124 branch of handle_engine_failure; the normal-run commit/push path is untouched. 2 files, +273/−25.
Linked issue analysis
Closes #1660 (rescoped: checkpoint only, resume out of scope). All acceptance criteria are substantively addressed:
- AC1 — push happens before the run exits:
exit 124is delivered synchronously to the orchestrating shell (GNUtimeoutwraps only the engine child), so the checkpoint runs in ordinary control flow. The PR states which approach was chosen and why (trap has no signal to catch; fractional checkpoint would guess) — exactly what the issue asked for. - AC2 — distinct
checkpoint(dev-lead): INCOMPLETE —prefix; no PR opened, no completion claim posted; test asserts nostatus=completedmarker, keeping the harness-only resolution gate (#1621/#1691) closed. - AC3 — escalation names the pushed branch and calls the work partial/unreviewed, replacing "not recoverable from this run"; honest fallback retained when the push fails.
- AC4 — non-timeout path is byte-identical: the checkpoint mirrors the existing success-path
git add -A/git push --set-upstreamand the diff touches only the timeout branch. Verified against the head-SHA script. - AC5 — four new bats tests cover: committed-work checkpoint (clean tree), uncommitted-work checkpoint with marker assertions, push-failure fallback, resolution-gate-stays-closed, and unchanged non-timeout success.
Findings
No blocking findings.
- Variable scoping (verified OK):
checkpoint_push_partial_workreadsbranch/pre_engine_sha, which are locals of the caller ofhandle_engine_failure— visible via bash dynamic scoping, the same pre-existing pattern the old work-note code used. - Unresolved review threads (2, codeant-ai, non-blocking): (1)
git add -Abreadth — declined as-is by design; it mirrors the success-path commit and the runner is ephemeral/single-issue, with gitleaks gating secrets. (2) Plain-push race — declined; the branch name is per-run date-stamped so a concurrent-update rejection is effectively impossible, and the code falls back to the honest "not recoverable" note. Both replies are technically sound and codeant-ai acknowledged each by saving a matching review instruction. All 8 gemini-code-assist threads are resolved/outdated. No unanswered human-reviewer questions. - Minor nuance (non-blocking): on the committed-work-only path (clean tree) no new commit is created, so the INCOMPLETE marker appears only in the escalation notice, not in a commit message. The branch is still unmistakably flagged partial/unreviewed on the issue, which satisfies the intent of AC2.
- Secret scan:
run_secret_scanningMCP tool not available in this environment; gitleaks CI check passed and the diff contains no credential-like content.
CI status
All checks green: shellcheck, bats, unit-tests, holdout-guard, CodeQL, SonarCloud quality gate, gitleaks, agent-shield, actionlint, and all policy/validation gates SUCCESS. Cancelled entries in the rollup are superseded review/dev-lead workflow runs, not code checks. mergeStateStatus BLOCKED solely on the pending review requirement.
Reviewed automatically by the PR-review agent (single-reviewer mode: fable 5). Reply if you need a human review.
|
No description provided. |
|
Advisory bots were rate-limited; auto-approval is withheld until they recover. pr-review-sweep will re-review this PR after 2026-09-08T03:17:35Z. |
Dev-Lead — waiting on PR blockers (intent: fix-reviews)PR: #1709 |
Dev-Lead — fix-bot-comment (no-changes)Agent reasoning |
|
Advisory bots were rate-limited; auto-approval is withheld until they recover. pr-review-sweep will re-review this PR after 2026-09-08T04:18:51Z. |
|



User description
Closes #1660
Implemented by dev-lead agent. Please review.
Summary by CodeRabbit
New Features
Bug Fixes
CodeAnt-AI Description
Preserve partial work from timed-out issue runs
What Changed
Impact
✅ Recoverable partial work after timeouts✅ Clear incomplete status for checkpoint branches✅ No false completion claims for timed-out runs💡 Usage Guide
Checking Your Pull Request
Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.
Talking to CodeAnt AI
Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:
This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.
Example
Preserve Org Learnings with CodeAnt
You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:
This helps CodeAnt AI learn and adapt to your team's coding style and standards.
Example
Retrigger review
Ask CodeAnt AI to review the PR again, by typing:
Check Your Repository Health
To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.