t1085: Remove artificial pulse counter from Phase 14, use natural guards#1641
t1085: Remove artificial pulse counter from Phase 14, use natural guards#1641marcusquinn merged 1 commit intomainfrom
Conversation
…s (t1085) Phase 14 AI reasoning now attempts on every pulse cycle instead of every 15th. Natural guards prevent waste: - should_run_ai_reasoning() checks has_actionable_work() pre-flight - Time-based cooldown (SUPERVISOR_AI_COOLDOWN, default 300s) replaces pulse-count interval (SUPERVISOR_AI_INTERVAL) - Lock file in run_ai_reasoning() prevents concurrent sessions The pulse counter was redundant throttling on top of these guards, causing 30-minute blind spots where the supervisor couldn't reason even when actionable work appeared.
Summary of ChangesHello @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 refactors the AI supervisor's reasoning trigger mechanism to remove an artificial pulse-based throttling system. The change aims to enhance the supervisor's responsiveness to actionable work by allowing it to attempt reasoning on every pulse cycle, while relying on more efficient, natural guards such as a time-based cooldown and a check for actionable tasks. This leads to a simpler, more effective, and less wasteful AI reasoning process. Highlights
Changelog
Using Gemini Code AssistThe 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
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 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
|
|
Caution Review failedFailed to post review comments WalkthroughThe pull request replaces an interval-based AI reasoning cadence system with a timestamp-driven cooldown mechanism. Changes affect AI gating logic in the supervisor scripts, removing pulse-count tracking and introducing elapsed-time checks against a configurable 300-second default cooldown, with optional force-bypass capability. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 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: Wed Feb 18 14:10:21 UTC 2026 Generated by AI DevOps Framework Code Review Monitoring |
|
There was a problem hiding this comment.
Code Review
The pull request successfully refactors the AI reasoning trigger mechanism by removing the artificial pulse counter and implementing a more robust system based on natural guards: checking for actionable work, a time-based cooldown, and a lock file for concurrency control. This change simplifies the code and allows for a more responsive AI supervisor. The updated comments and logging messages accurately reflect the new logic. However, a potential issue was identified where a function argument ($2) is not being correctly captured into a local variable, which could lead to incorrect behavior in downstream function calls.
| # Arguments: | ||
| # $1 - (optional) force: "true" to skip interval check | ||
| # $1 - (optional) force: "true" to skip cooldown check | ||
| # $2 - (optional) repo_path |
There was a problem hiding this comment.
The comment on this line indicates that $2 is repo_path. However, the should_run_ai_reasoning function's implementation does not explicitly capture this second argument into a local variable. This means that the has_actionable_work function, which is called within should_run_ai_reasoning and expects repo_path as an argument, will likely receive an empty or unset variable, potentially leading to incorrect behavior. Please update the function body to capture $2 into a local repo_path variable.



Summary
should_run_ai_reasoning()→has_actionable_work()pre-flight (skip if nothing to reason about)SUPERVISOR_AI_COOLDOWN(default 300s = 5 min) replacesSUPERVISOR_AI_INTERVALrun_ai_reasoning()prevents concurrent AI sessionsWhy
The pulse counter created 30-minute blind spots where the supervisor couldn't reason even when actionable work appeared. The natural guards (actionable work check + cooldown + lock file) already prevent waste — the counter was redundant throttling on top of them.
Config change
SUPERVISOR_AI_INTERVAL(pulse count, default 15)SUPERVISOR_AI_COOLDOWN(seconds, default 300)Existing deployments using
SUPERVISOR_AI_INTERVALwill silently ignore it and use the new 5-minute cooldown default.Summary by CodeRabbit
Bug Fixes
Improvements