Skip to content

fix: skip Phase 4b2 legacy pr_review recovery when AI lifecycle is active#2108

Merged
marcusquinn merged 1 commit intomainfrom
bugfix/phase4b2-skip-ai-lifecycle
Feb 21, 2026
Merged

fix: skip Phase 4b2 legacy pr_review recovery when AI lifecycle is active#2108
marcusquinn merged 1 commit intomainfrom
bugfix/phase4b2-skip-ai-lifecycle

Conversation

@marcusquinn
Copy link
Owner

@marcusquinn marcusquinn commented Feb 21, 2026

Summary

  • Phase 4b2 (stale pr_review recovery) was running the legacy cmd_pr_lifecycle on tasks that Phase 3's AI lifecycle had already processed
  • This clobbered AI decisions — e.g., marking tasks as "Merge failed" when the AI had already decided to escalate or wait
  • Fix: wrap Phase 4b2 in the same SUPERVISOR_AI_LIFECYCLE guard used for Phase 3.5/3.6

Evidence

3 of 6 awards app tasks (t005.2, t007.8, t010) were re-blocked by Phase 4b2 with "Merge failed" immediately after the AI lifecycle correctly processed them in Phase 3.

Summary by CodeRabbit

  • Bug Fixes

    • Enhanced stale PR review handling with improved logging to provide better visibility into PR lifecycle status changes and processing outcomes.
  • Chores

    • Optimized PR lifecycle recovery logic with conditional processing that improves efficiency and reduces potential conflicts when handling stale PR reviews during automated lifecycle management.

@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 addresses an issue where an older, legacy pr_review recovery process was interfering with the newer AI-driven lifecycle management for tasks. By conditionally disabling the legacy recovery when the AI lifecycle is active, the change ensures that AI decisions regarding pull request statuses are preserved and not inadvertently overwritten, thereby improving the reliability of automated PR workflows.

Highlights

  • AI Lifecycle Protection: Prevented the legacy Phase 4b2 stale pr_review recovery mechanism from overriding decisions made by the AI-driven lifecycle in Phase 3. This ensures AI decisions (e.g., escalate, wait) are not erroneously marked as "Merge failed".
Changelog
  • .agents/scripts/supervisor/pulse.sh
    • Wrapped the Phase 4b2 stale pr_review recovery logic within a conditional block, ensuring it only executes when SUPERVISOR_AI_LIFECYCLE is not set to "true".
Activity
  • No specific activity (comments, reviews, progress) has been provided for this pull request.
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.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 21, 2026

No actionable comments were generated in the recent review. 🎉


Walkthrough

Phase 4b2 stale pr_review recovery in pulse.sh now conditionally gates based on SUPERVISOR_AI_LIFECYCLE flag. AI-enabled paths skip legacy pr_lifecycle retry logic, while non-AI paths retain existing behavior with enhanced logging for status transitions and failure visibility.

Changes

Cohort / File(s) Summary
Supervisor Pulse Lifecycle Gating
.agents/scripts/supervisor/pulse.sh
Added conditional SUPERVISOR_AI_LIFECYCLE guard around Phase 4b2 stale pr_review recovery. When AI lifecycle enabled, legacy pr_lifecycle retry logic is bypassed. When disabled, original path activates with enhanced logging: distinguishes successful advancement from stalled pr_review status, and logs explicit warning on lifecycle command failure with next-pulse retry indication.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🤖 The pulse now thinks before it acts,
AI paths take flight, legacy compacts,
Stale reviews no longer clash,
With clearer logs and smarter gash! ✨

🚥 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 directly and accurately summarizes the main change: conditionally skipping Phase 4b2 legacy pr_review recovery when AI lifecycle is active, which matches the core fix described in the PR objectives.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

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

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch bugfix/phase4b2-skip-ai-lifecycle

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, 38 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Sat Feb 21 15:26:53 UTC 2026: Code review monitoring started
Sat Feb 21 15:26:54 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 38

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 38
  • VULNERABILITIES: 0

Generated on: Sat Feb 21 15:26:56 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

@sonarqubecloud
Copy link

@marcusquinn marcusquinn merged commit a0bf6a5 into main Feb 21, 2026
10 of 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

The pull request correctly implements a guard to skip legacy pr_review recovery when the AI lifecycle is active, preventing conflicts between the two systems. I have identified a style guide violation regarding error suppression that should be addressed for consistency and safety.

log_warn " Stale pr_review: $spr_id (last updated: ${spr_updated:-unknown}, >${pr_review_stale_seconds}s) — re-attempting lifecycle (t1208)"
if cmd_pr_lifecycle "$spr_id" 2>>"$SUPERVISOR_LOG"; then
local spr_new_status
spr_new_status=$(db "$SUPERVISOR_DB" "SELECT status FROM tasks WHERE id = '$(sql_escape "$spr_id")';" 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

Avoid blanket suppression of errors with 2>/dev/null. If the database query fails, the error should be visible for debugging purposes.

Suggested change
spr_new_status=$(db "$SUPERVISOR_DB" "SELECT status FROM tasks WHERE id = '$(sql_escape "$spr_id")';" 2>/dev/null || echo "")
spr_new_status=$(db "$SUPERVISOR_DB" "SELECT status FROM tasks WHERE id = '$(sql_escape "$spr_id")';" || echo "")
References
  1. Avoid using '2>/dev/null' for blanket suppression of command errors in shell scripts to ensure that authentication, syntax, or system issues remain visible for debugging.

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