Skip to content

fix: pulse should close open issues labelled status:done#2456

Merged
marcusquinn merged 1 commit intomainfrom
bugfix/pulse-close-done-issues
Feb 27, 2026
Merged

fix: pulse should close open issues labelled status:done#2456
marcusquinn merged 1 commit intomainfrom
bugfix/pulse-close-done-issues

Conversation

@marcusquinn
Copy link
Owner

@marcusquinn marcusquinn commented Feb 27, 2026

Summary

  • Adds a check to Step 2a in pulse.md that finds open issues with status:done label and closes them with a comment
  • Idempotent and safe to run every pulse cycle

Problem

Observed webapp issues #288, #292, #293 — labelled status:done by 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:done when work completes, but the issue close can fail silently (e.g., issue-sync workflow didn't fire, or the gh issue close command 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:done label and close them with an explanatory comment.

Summary by CodeRabbit

  • New Features
    • Automatic closure of issues marked status:done is now integrated into periodic supervisor maintenance cycles. Closed issues receive standard closure comments. The process is idempotent and safely repeatable with each execution cycle.

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.
@gemini-code-assist
Copy link

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@github-actions github-actions bot added the bug Auto-created from TODO.md tag label Feb 27, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 27, 2026

Walkthrough

Introduces automatic closure of open issues labeled status:done into the supervisor pulse workflow. Adds a Bash code block to Step 2a (Observe Outcomes) that lists matching issues and closes each with a standard comment. Marked as idempotent and safe for repeated execution.

Changes

Cohort / File(s) Summary
Pulse Workflow Enhancement
.agents/scripts/commands/pulse.md
Added automated issue-closing logic to Step 2a that identifies and closes open issues with the status:done label using GitHub API calls, idempotent for safe repeated execution.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Possibly related PRs

Suggested labels

bug

Poem

✨ Issues marked as done now find their rest,
A gentle pulse closes what's best,
Status:done labels fade to sleep,
Automation promises to keep,
Idempotent and safe, the workflow's blessed! 🎯

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding functionality to close open issues labeled status:done in the pulse process.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch bugfix/pulse-close-done-issues

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link

🔍 Code Quality Report

�[0;35m[MONITOR]�[0m Code Review Monitoring Report

�[0;34m[INFO]�[0m Latest Quality Status:
SonarCloud: 0 bugs, 0 vulnerabilities, 36 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Fri Feb 27 06:05:12 UTC 2026: Code review monitoring started
Fri Feb 27 06:05:13 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 36

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 36
  • VULNERABILITIES: 0

Generated on: Fri Feb 27 06:05:16 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

@sonarqubecloud
Copy link

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

ℹ️ Review info

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e00131f and 8f9607f.

📒 Files selected for processing (1)
  • .agents/scripts/commands/pulse.md

Comment on lines +107 to +110
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

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.

Suggested change
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Auto-created from TODO.md tag

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant