Skip to content

Comments

t1038: Reconcile terminal DB states with GitHub issues in pulse Phase 3c#1390

Merged
marcusquinn merged 1 commit intomainfrom
bugfix/t1038-reconcile-terminal-issues
Feb 13, 2026
Merged

t1038: Reconcile terminal DB states with GitHub issues in pulse Phase 3c#1390
marcusquinn merged 1 commit intomainfrom
bugfix/t1038-reconcile-terminal-issues

Conversation

@marcusquinn
Copy link
Owner

Summary

  • Tasks reaching terminal states (cancelled, failed, verified) via direct DB updates bypass cmd_transition and its sync_issue_status_label call, leaving GitHub issues open with stale labels
  • Adds Phase 3c to the pulse: sweeps terminal-state tasks with recent activity, checks if their GitHub issue is still open, and syncs
  • 10-minute cooldown to avoid API rate limits
  • Immediate trigger: t1010 was cancelled but its issue t1010: Track model usage per task via GitHub issue labels #1300 stayed open with status:verify-failed

Refs: t1038, GH#1389

Tasks can reach terminal states (cancelled, failed, verified, deployed)
via direct DB updates or manual intervention, bypassing cmd_transition
and its sync_issue_status_label call. This leaves GitHub issues open
when the DB says the task is done.

Phase 3c sweeps tasks in terminal states that had recent activity (last
7 days), checks if their GitHub issue is still open, and syncs the
state. Runs at most once per 10 minutes to avoid API rate limits.

Root cause: t1010 was cancelled via direct DB update, but its GitHub
issue #1300 remained open with stale status:verify-failed label.

Refs: t1038, GH#1389
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 13, 2026

Warning

Rate limit exceeded

@marcusquinn has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 21 minutes and 5 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch bugfix/t1038-reconcile-terminal-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.

@gemini-code-assist
Copy link

Summary of Changes

Hello @marcusquinn, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a new reconciliation mechanism to the supervisor script, ensuring that GitHub issue labels accurately reflect the terminal states of tasks in the database. This addresses a discrepancy where direct database updates could bypass the usual synchronization process, leaving GitHub issues with stale status labels. The new phase periodically checks and updates these issues, incorporating a cooldown to manage API usage.

Highlights

  • Problem Identification: Tasks transitioning to terminal states (cancelled, failed, verified, deployed) through direct database updates or manual intervention were bypassing the standard cmd_transition process, leading to GitHub issues retaining outdated status labels.
  • Solution Implementation: Introduced "Phase 3c" into the pulse.sh script, which periodically scans for tasks in terminal states with recent activity and checks if their corresponding GitHub issues are still open. If an issue is open, its status label is synchronized.
  • Rate Limit Prevention: Implemented a 10-minute cooldown mechanism for Phase 3c to prevent excessive calls to the GitHub API and avoid hitting rate limits.
  • Specific Trigger: The need for this feature was highlighted by task t1010, which was cancelled but its GitHub issue t1010: Track model usage per task via GitHub issue labels #1300 remained incorrectly labeled as status:verify-failed.
Changelog
  • .agents/scripts/supervisor/pulse.sh
    • Added Phase 3c logic to cmd_pulse to reconcile terminal task states with GitHub issue labels.
    • Implemented a 10-minute cooldown for the reconciliation process.
    • Included database queries to identify relevant terminal tasks and GitHub API calls to check and update issue states.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@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, 22 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Fri Feb 13 15:59:24 UTC 2026: Code review monitoring started
Fri Feb 13 15:59:24 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 22

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 22
  • VULNERABILITIES: 0

Generated on: Fri Feb 13 15:59:27 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

@sonarqubecloud
Copy link

@marcusquinn marcusquinn merged commit 3021c32 into main Feb 13, 2026
11 checks passed
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new reconciliation phase (3c) to the supervisor pulse, which is a great addition for ensuring data consistency between the local database and GitHub issues. The implementation is solid, with a cooldown mechanism to prevent API rate limiting and a targeted query to find relevant tasks. My review includes a few suggestions to improve error logging by adhering to the repository's style guide, which will enhance the script's robustness and debuggability.

SELECT DISTINCT task_id FROM state_log
WHERE timestamp > datetime('now', '-7 days')
)
;" 2>/dev/null || echo "")

Choose a reason for hiding this comment

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

medium

Error output from the db command is being suppressed. According to the repository style guide (line 50), 2>/dev/null should only be used when redirecting to log files, not for blanket suppression. To aid in debugging, please redirect stderr to the supervisor log file.

Suggested change
;" 2>/dev/null || echo "")
;" 2>>"$SUPERVISOR_LOG" || echo "")
References
  1. Style guide (line 50) states: 2>/dev/null is acceptable ONLY when redirecting to log files, not blanket suppression. (link)


# Find the GitHub issue number
local rec_issue
rec_issue=$(find_task_issue_number "$rec_id" "$rec_repo" 2>/dev/null || echo "")

Choose a reason for hiding this comment

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

medium

Error output from find_task_issue_number is being suppressed. According to the repository style guide (line 50), errors should be logged. Please redirect stderr to the supervisor log file for better debuggability.

Suggested change
rec_issue=$(find_task_issue_number "$rec_id" "$rec_repo" 2>/dev/null || echo "")
rec_issue=$(find_task_issue_number "$rec_id" "$rec_repo" 2>>"$SUPERVISOR_LOG" || echo "")
References
  1. Style guide (line 50) states: 2>/dev/null is acceptable ONLY when redirecting to log files, not blanket suppression. (link)

[[ -z "$rec_issue" ]] && continue

local rec_slug
rec_slug=$(detect_repo_slug "$rec_repo" 2>/dev/null || echo "")

Choose a reason for hiding this comment

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

medium

Error output from detect_repo_slug is being suppressed. Per the repository style guide (line 50), errors should be logged. Please redirect stderr to the supervisor log file.

Suggested change
rec_slug=$(detect_repo_slug "$rec_repo" 2>/dev/null || echo "")
rec_slug=$(detect_repo_slug "$rec_repo" 2>>"$SUPERVISOR_LOG" || echo "")
References
  1. Style guide (line 50) states: 2>/dev/null is acceptable ONLY when redirecting to log files, not blanket suppression. (link)


# Check if the issue is still open
local issue_state
issue_state=$(gh issue view "$rec_issue" --repo "$rec_slug" --json state -q .state 2>/dev/null || echo "")

Choose a reason for hiding this comment

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

medium

Error output from the gh command is being suppressed. This could hide important issues like authentication failures. As per the repository style guide (line 50), please redirect stderr to the supervisor log file.

Suggested change
issue_state=$(gh issue view "$rec_issue" --repo "$rec_slug" --json state -q .state 2>/dev/null || echo "")
issue_state=$(gh issue view "$rec_issue" --repo "$rec_slug" --json state -q .state 2>>"$SUPERVISOR_LOG" || echo "")
References
  1. Style guide (line 50) states: 2>/dev/null is acceptable ONLY when redirecting to log files, not blanket suppression. (link)

fi
fi

date +%s >"$reconcile_cooldown_file" 2>/dev/null || true

Choose a reason for hiding this comment

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

medium

For consistency with logging errors, and to adhere to the style guide (line 50), consider logging potential errors when writing to the cooldown file instead of suppressing them.

Suggested change
date +%s >"$reconcile_cooldown_file" 2>/dev/null || true
date +%s >>"$reconcile_cooldown_file" 2>>"$SUPERVISOR_LOG" || true
References
  1. Style guide (line 50) states: 2>/dev/null is acceptable ONLY when redirecting to log files, not blanket suppression. (link)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant