t2837: Fix pulse --batch mode that still runs auto-pickup and ingests unrelated tasks#2843
Conversation
WalkthroughModifies Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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 Mar 4 17:44:55 UTC 2026 Generated by AI DevOps Framework Code Review Monitoring |
Summary of ChangesHello, 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 a critical issue in the 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.
🧹 Nitpick comments (1)
.agents/scripts/supervisor-archived/pulse.sh (1)
1875-1890: Add explicit skip logging for Phase 0.9 in batch mode.This path now skips correctly, but unlike Phase 0 and Phase 2b it has no explicit trace log when
--batchis set.Suggested patch
- if [[ -z "$batch_id" ]]; then + if [[ -z "$batch_id" ]]; then local queued_before_sanity queued_before_sanity=$(db "$SUPERVISOR_DB" "SELECT COUNT(*) FROM tasks WHERE status = 'queued';" 2>/dev/null || echo 0) if [[ "$queued_before_sanity" -eq 0 ]]; then # No queued tasks — check if there are open tasks in TODO.md that should be dispatchable if [[ -n "$all_repos" ]]; then while IFS= read -r repo_path; do _run_sanity_check_for_repo "$repo_path" done <<<"$all_repos" else _run_sanity_check_for_repo "$(pwd)" fi fi + else + log_info "Phase 0.9: Skipping sanity check/auto-pickup (--batch $batch_id specified, t2837)" fi🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.agents/scripts/supervisor-archived/pulse.sh around lines 1875 - 1890, The Phase 0.9 branch currently only runs when batch_id is empty and lacks an explicit log when skipped in batch mode; add a trace/log call in the else branch of the if [[ -z "$batch_id" ]]; then ... fi block so that when batch_id is set you emit a message like "Skipping Phase 0.9 sanity check due to --batch" (use the same logging helper used elsewhere in this script to match Phase 0/Phase 2b messages), keeping the existing logic that calls _run_sanity_check_for_repo when batch_id is empty.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In @.agents/scripts/supervisor-archived/pulse.sh:
- Around line 1875-1890: The Phase 0.9 branch currently only runs when batch_id
is empty and lacks an explicit log when skipped in batch mode; add a trace/log
call in the else branch of the if [[ -z "$batch_id" ]]; then ... fi block so
that when batch_id is set you emit a message like "Skipping Phase 0.9 sanity
check due to --batch" (use the same logging helper used elsewhere in this script
to match Phase 0/Phase 2b messages), keeping the existing logic that calls
_run_sanity_check_for_repo when batch_id is empty.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 472d8830-bda1-49e6-a2e1-a49c058d932f
📒 Files selected for processing (1)
.agents/scripts/supervisor-archived/pulse.sh
There was a problem hiding this comment.
Code Review
The pull request effectively addresses the issue of pulse --batch mode incorrectly running auto-pickup and ingesting unrelated tasks. The changes correctly gate the cmd_auto_pickup calls in Phase 0, Phase 0.9 (sanity check), and Phase 2b (stall recovery) based on the presence of a batch_id. This prevents the creation of phantom batches and collateral cancellations, as detailed in the PR description. The addition of log_info messages for skipped phases enhances traceability and debugging. The modifications are additive and maintain the existing autonomous pulse behavior when the --batch flag is not used.



Summary
cmd_auto_pickupcall sites incmd_pulse()onbatch_idbeing empty, sopulse --batch <id>only manages tasks within the specified batch#auto-dispatchtasks and creating phantom batches during targeted batch dispatchRoot Cause
When running
pulse --batch <id>, three code paths incmd_pulse()calledcmd_auto_pickupunconditionally:#auto-dispatchtasksAuto-pickup adds tasks to the supervisor DB and creates new batches for unbatched tasks. In targeted batch mode, this caused 13 unrelated tasks to be ingested into a phantom batch, which were then cancelled as collateral when the phantom batch was cancelled — leaving them as
cancelledin the DB but[ ]in TODO.md, triggering Phase 0.5c annotation loops on every subsequent pulse.Testing
--batchflag) is completely unchangedCloses #2837
Summary by CodeRabbit