fix: pulse should close open issues labelled status:done#2456
fix: pulse should close open issues labelled status:done#2456marcusquinn merged 1 commit intomainfrom
Conversation
The pulse was skipping open issues with status:done, assuming they were already closed. In reality, the close step sometimes fails silently (issue-sync workflow didn't fire, gh command failed, etc.), leaving issues open indefinitely. Add explicit check to Step 2a. Observed: awardsapp #288, #292, #293 stuck open for 3+ hours.
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
WalkthroughIntroduces automatic closure of open issues labeled Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 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 |
🔍 Code Quality Report�[0;35m[MONITOR]�[0m Code Review Monitoring Report �[0;34m[INFO]�[0m Latest Quality Status: �[0;34m[INFO]�[0m Recent monitoring activity: 📈 Current Quality Metrics
Generated on: Fri Feb 27 06:05:16 UTC 2026 Generated by AI DevOps Framework Code Review Monitoring |
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.agents/scripts/commands/pulse.md:
- Around line 107-110: Before calling gh issue close, re-check each issue's
current state using the mandatory t1343 guard: for each ID in DONE_ISSUES (the
loop over num), call gh issue view "$num" --repo <slug> --json state --jq
'.state' (or equivalent) and only run gh issue close when that returned state
equals "OPEN" (skip otherwise); preserve existing error suppression (2>/dev/null
|| true) and ensure the check is performed immediately inside the loop right
before gh issue close to remain race-safe.
| DONE_ISSUES=$(gh issue list --repo <slug> --state open --label "status:done" --json number,title --jq '.[] | .number' 2>/dev/null || echo "") | ||
| for num in $DONE_ISSUES; do | ||
| gh issue close "$num" --repo <slug> --comment "Supervisor pulse: closing — issue was labelled status:done but left open." 2>/dev/null || true | ||
| done |
There was a problem hiding this comment.
Apply the mandatory t1343 state guard before gh issue close
This new loop modifies issues without the required explicit OPEN re-check. Since Step 2a marks this guard as mandatory for any issue modification, this should re-validate state immediately before closing to stay fail-closed and race-safe.
🔧 Suggested patch
DONE_ISSUES=$(gh issue list --repo <slug> --state open --label "status:done" --json number,title --jq '.[] | .number' 2>/dev/null || echo "")
for num in $DONE_ISSUES; do
- gh issue close "$num" --repo <slug> --comment "Supervisor pulse: closing — issue was labelled status:done but left open." 2>/dev/null || true
+ STATE=$(gh issue view "$num" --repo <slug> --json state -q .state 2>/dev/null || echo "UNKNOWN")
+ if [[ "$STATE" == "OPEN" ]]; then
+ gh issue close "$num" --repo <slug> --comment "Supervisor pulse: closing — issue was labelled status:done but left open." 2>/dev/null || true
+ else
+ echo "[t1343] Issue #$num state is $STATE (not OPEN) — skipping close"
+ fi
done📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| DONE_ISSUES=$(gh issue list --repo <slug> --state open --label "status:done" --json number,title --jq '.[] | .number' 2>/dev/null || echo "") | |
| for num in $DONE_ISSUES; do | |
| gh issue close "$num" --repo <slug> --comment "Supervisor pulse: closing — issue was labelled status:done but left open." 2>/dev/null || true | |
| done | |
| DONE_ISSUES=$(gh issue list --repo <slug> --state open --label "status:done" --json number,title --jq '.[] | .number' 2>/dev/null || echo "") | |
| for num in $DONE_ISSUES; do | |
| STATE=$(gh issue view "$num" --repo <slug> --json state -q .state 2>/dev/null || echo "UNKNOWN") | |
| if [[ "$STATE" == "OPEN" ]]; then | |
| gh issue close "$num" --repo <slug> --comment "Supervisor pulse: closing — issue was labelled status:done but left open." 2>/dev/null || true | |
| else | |
| echo "[t1343] Issue #$num state is $STATE (not OPEN) — skipping close" | |
| fi | |
| done |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.agents/scripts/commands/pulse.md around lines 107 - 110, Before calling gh
issue close, re-check each issue's current state using the mandatory t1343
guard: for each ID in DONE_ISSUES (the loop over num), call gh issue view "$num"
--repo <slug> --json state --jq '.state' (or equivalent) and only run gh issue
close when that returned state equals "OPEN" (skip otherwise); preserve existing
error suppression (2>/dev/null || true) and ensure the check is performed
immediately inside the loop right before gh issue close to remain race-safe.



Summary
pulse.mdthat finds open issues withstatus:donelabel and closes them with a commentProblem
Observed webapp issues #288, #292, #293 — labelled
status:doneby workers but never closed. The pulse assumed the label meant they were already closed, so they stayed open indefinitely.Root cause
Workers label issues
status:donewhen work completes, but the issue close can fail silently (e.g., issue-sync workflow didn't fire, or thegh issue closecommand failed). No supervisor check existed to catch this gap.Fix
Added guidance to pulse.md Step 2a: for each pulse-enabled repo, query open issues with
status:donelabel and close them with an explanatory comment.Summary by CodeRabbit