fix(recovery): skip recovery for issues with scheduled future monitors#6558
fix(recovery): skip recovery for issues with scheduled future monitors#6558jelsco wants to merge 1 commit into
Conversation
Both the post-run handoff decision (decideSuccessfulRunHandoff) and the periodic stranded-issue sweep (reconcileStrandedAssignedIssues) were classifying in_progress issues with succeeded runs as "missing disposition" even when the issue had a future monitorNextCheckAt. This caused false-positive recovery loops on deliberately-parked issues (e.g., LinkedIn content calendar posts waiting for a publish-runner routine). The issue-graph-liveness system already had hasScheduledMonitor() that correctly skipped such issues, but these two other recovery paths did not. Changes: - Add hasScheduledMonitor boolean to decideSuccessfulRunHandoff input type and skip when true - Select monitorNextCheckAt in handleSuccessfulRunHandoff issue query and pass it to the decision function - Add monitorNextCheckAt > now check in reconcileStrandedAssignedIssues after the hasActiveExecutionPath guard - Unit test for the new skip in successful-run-handoff.test.ts - Two integration tests in heartbeat-process-recovery.test.ts covering both the handoff and sweep paths Co-Authored-By: Claude Opus 4.6 <[email protected]>
Greptile SummaryThis PR fixes false-positive recovery loops on "parked" issues that have a future
Confidence Score: 4/5Safe to merge once the PR description is updated to include the required Thinking Path, Risks, and Model Used sections per the project template. The logic change is small and well-targeted: two new early-exit guards backed by unit and integration tests, with No files require special attention for correctness; the PR description itself needs the missing template sections filled in before merge. Important Files Changed
Prompt To Fix All With AIFix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
server/src/services/recovery/successful-run-handoff.ts:376
**PR template sections missing**
The PR description does not follow the required template from `.github/PULL_REQUEST_TEMPLATE.md`. The following required sections are absent or incomplete:
- **Thinking Path** — must trace reasoning from project context down to this specific change (5–8 blockquote steps, per `CONTRIBUTING.md`)
- **Risks** — no explicit risk assessment (e.g., what happens if a monitor timestamp is stale or the guard fires during a legitimate recovery window)
- **Model Used** — "Generated with Claude Code" in the footer is not the required section; the template asks for provider, exact model ID/version, context window, and reasoning mode
Per `CONTRIBUTING.md`, all PRs must use the template and fill out all sections before requesting merge.
Reviews (1): Last reviewed commit: "fix(recovery): skip recovery for issues ..." | Re-trigger Greptile |
| } | ||
| if (input.hasActiveExecutionPath) return { kind: "skip", reason: "issue already has an active execution path" }; | ||
| if (input.hasQueuedWake) return { kind: "skip", reason: "issue already has a queued or deferred wake" }; | ||
| if (input.hasScheduledMonitor) return { kind: "skip", reason: "issue has a scheduled future monitor" }; |
There was a problem hiding this comment.
The PR description does not follow the required template from .github/PULL_REQUEST_TEMPLATE.md. The following required sections are absent or incomplete:
- Thinking Path — must trace reasoning from project context down to this specific change (5–8 blockquote steps, per
CONTRIBUTING.md) - Risks — no explicit risk assessment (e.g., what happens if a monitor timestamp is stale or the guard fires during a legitimate recovery window)
- Model Used — "Generated with Claude Code" in the footer is not the required section; the template asks for provider, exact model ID/version, context window, and reasoning mode
Per CONTRIBUTING.md, all PRs must use the template and fill out all sections before requesting merge.
Context Used: CONTRIBUTING.md has a guide for a good PR message ... (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: server/src/services/recovery/successful-run-handoff.ts
Line: 376
Comment:
**PR template sections missing**
The PR description does not follow the required template from `.github/PULL_REQUEST_TEMPLATE.md`. The following required sections are absent or incomplete:
- **Thinking Path** — must trace reasoning from project context down to this specific change (5–8 blockquote steps, per `CONTRIBUTING.md`)
- **Risks** — no explicit risk assessment (e.g., what happens if a monitor timestamp is stale or the guard fires during a legitimate recovery window)
- **Model Used** — "Generated with Claude Code" in the footer is not the required section; the template asks for provider, exact model ID/version, context window, and reasoning mode
Per `CONTRIBUTING.md`, all PRs must use the template and fill out all sections before requesting merge.
**Context Used:** CONTRIBUTING.md has a guide for a good PR message ... ([source](https://app.greptile.com/review/custom-context?memory=instruction-0))
How can I resolve this? If you propose a fix, please make it concise.
Summary
Fixes false-positive recovery loops on deliberately-parked issues that have a future
monitorNextCheckAt(e.g., LinkedIn content calendar posts waiting for a publish-runner routine).hasScheduledMonitorboolean todecideSuccessfulRunHandoff()— skips handoff when the issue has a scheduled future monitormonitorNextCheckAtinhandleSuccessfulRunHandoff()issue query and pass it to the decision functionmonitorNextCheckAt > nowguard inreconcileStrandedAssignedIssues()after thehasActiveExecutionPathcheckContext
The
issue-graph-liveness.tssystem already hadhasScheduledMonitor()that correctly skipped such issues, but two other recovery paths did not:handleSuccessfulRunHandoff)reconcileStrandedAssignedIssues)Fixes RR-1768 (parent: RR-1763). Unblocks RR-1547, RR-1548, RR-1776, RR-1777 (LinkedIn posts stuck in recovery loops).
Test plan
"skips when issue has a scheduled future monitor"insuccessful-run-handoff.test.ts"skips successful-run handoff when issue has a future monitorNextCheckAt"inheartbeat-process-recovery.test.ts"skips stranded sweep when issue has a future monitorNextCheckAt"inheartbeat-process-recovery.test.ts🤖 Generated with Claude Code