t1138: Add cycle-level action dedup to prevent repeated actions on same targets#1736
t1138: Add cycle-level action dedup to prevent repeated actions on same targets#1736marcusquinn merged 3 commits intomainfrom
Conversation
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the 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)
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 |
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 introduces a crucial deduplication mechanism to the AI supervisor's action execution pipeline. Its primary purpose is to prevent the AI from repeatedly performing the same actions on the same targets across different reasoning cycles, addressing a noted inefficiency where the AI would act multiple times on the same issues or tasks. By implementing a cycle-based rolling window for action history and a dedicated database log, the system can now identify and suppress redundant actions, leading to more efficient AI operation and reduced unnecessary resource consumption. Highlights
Changelog
Activity
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
|
There was a problem hiding this comment.
Code Review
This pull request introduces a robust deduplication mechanism to prevent the AI supervisor from performing repeated actions on the same targets, which is a great enhancement for efficiency and system behavior. The implementation is well-structured, with clear separation of concerns into target extraction, duplication checking, and recording logic. The addition of the dedup-stats CLI command is also a nice touch for observability.
My review focuses on improving robustness and maintainability. I've identified a few areas for improvement:
- A recurring pattern of suppressing database errors, which violates the repository's style guide and can hide underlying issues.
- A case where the action recording function can fail silently if the database is unavailable, which violates a repository rule regarding exit code propagation.
- Minor opportunities to reduce code duplication in both the shell script and the database migration script, aligning with general maintainability principles.
Overall, this is a solid contribution that addresses an important problem. Addressing these points will make the implementation even more resilient.
496df1c to
63f8bc8
Compare
🔍 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 18:30:44 UTC 2026 Generated by AI DevOps Framework Code Review Monitoring |
🔍 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 18:37:48 UTC 2026 Generated by AI DevOps Framework Code Review Monitoring |
…ith dead workers (t1145) Phase 0.7 (pulse.sh): when a stale 'evaluating' task has a pr_url, route to 'pr_review' instead of re-queuing — the work is done, only the evaluation process died. Previously, tasks with completed PRs were wastefully re-run. supervisor-helper.sh: add 'evaluating:pr_review' to VALID_TRANSITIONS to support the new Phase 0.7 routing path. cleanup.sh: include 'evaluating' in stale PID file detection alongside 'running' and 'dispatched' for consistent cleanup. Manual recovery applied to stale tasks found at time of fix: - t1138: evaluating (dead PID 63748) + PR #1736 → pr_review - t1139: running (dead PID 19930) + PR #1735 → pr_review (via evaluating) - t1146: running (dead PID 12745) no PR → queued (retry) - t1148: running (dead PID 14125) no PR → queued (retry) - t1149: running (dead PID 15457) no PR → queued (retry) DB now consistent: 1 running (t1145/self), 0 evaluating, 0 stale entries. Supersedes t1140 and t1132.
…e targets (t1138) Add enforcement mechanism to the AI supervisor action executor pipeline: - New action_dedup_log table stores rolling window of (cycle_id, action_type, target) tuples - Before executing an action, checks if same (action_type, target) pair was executed in last N cycles - Duplicate actions are skipped with dedup_suppressed status and logged - Configurable window via AI_ACTION_DEDUP_WINDOW env var (default: 5 cycles) - Auto-prunes entries older than 7 days during ensure_db - New dedup-stats CLI subcommand for observability - Target extraction handles all 9 action types (issue-based, task-based, title-based) Addresses supervisor self-reflection showing 10 targets receiving repeated actions across cycles (issues acted on 3x each, tasks acted on 2x each).
e8c7b2a to
68bf1a1
Compare
🔍 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 18:59:25 UTC 2026 Generated by AI DevOps Framework Code Review Monitoring |
|
… with dead workers (#1771) * chore: regenerate MODELS.md leaderboard (t1012, t1129) * fix: resolve supervisor DB inconsistency — stale running/evaluating with dead workers (t1145) Phase 0.7 (pulse.sh): when a stale 'evaluating' task has a pr_url, route to 'pr_review' instead of re-queuing — the work is done, only the evaluation process died. Previously, tasks with completed PRs were wastefully re-run. supervisor-helper.sh: add 'evaluating:pr_review' to VALID_TRANSITIONS to support the new Phase 0.7 routing path. cleanup.sh: include 'evaluating' in stale PID file detection alongside 'running' and 'dispatched' for consistent cleanup. Manual recovery applied to stale tasks found at time of fix: - t1138: evaluating (dead PID 63748) + PR #1736 → pr_review - t1139: running (dead PID 19930) + PR #1735 → pr_review (via evaluating) - t1146: running (dead PID 12745) no PR → queued (retry) - t1148: running (dead PID 14125) no PR → queued (retry) - t1149: running (dead PID 15457) no PR → queued (retry) DB now consistent: 1 running (t1145/self), 0 evaluating, 0 stale entries. Supersedes t1140 and t1132.



Summary
action_dedup_logSQLite table stores a rolling window of(cycle_id, action_type, target)tuples; before executing an action, the executor checks if the same pair was executed in the last N cycles (configurable viaAI_ACTION_DEDUP_WINDOW, default: 5)dedup_suppressedstatus, logged to both the action log and DB, and reported in the execution summarydedup-statsCLI subcommand for observability (ai-actions.sh dedup-stats)Details
Problem: The supervisor self-reflection showed 10 targets receiving repeated actions across cycles — issues #1572 and #1463 acted on 3 times each, 8 tasks acted on 2 times each. The AI reasoning prompt asked the supervisor to avoid repetition, but there was no enforcement mechanism.
Solution: Implemented in the action executor pipeline (not the AI prompt) as specified:
comment_on_issue,flag_for_review,request_info,close_verified→issue:N;adjust_priority,escalate_model→task:tN;create_task,create_improvement→title:...;create_subtasks→task:parent_idensure_dbRef #1709