t1455: add adaptive pulse queue-governor and strict worker counting#4218
t1455: add adaptive pulse queue-governor and strict worker counting#4218marcusquinn merged 1 commit intomainfrom
Conversation
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 introduces an intelligent, adaptive queue management system to optimize the allocation of resources between processing existing pull requests and dispatching new issues. By dynamically adjusting priorities based on current PR and issue backlogs, the system aims to improve overall throughput, ensure timely PR advancement, and prevent new issue work from overwhelming PR remediation efforts. This change enhances the system's responsiveness to varying workload pressures without requiring manual intervention. 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
|
WalkthroughThis PR introduces an adaptive queue governor mechanism for the pulse dispatch system. It adds dynamic queue-pressure metrics to pre-fetched state (queue mode, dispatch percentages), integrates calculation logic into the prefetch flow, updates pulse documentation with adaptive mode rules, and refines worker-detection patterns to exclude supervisor noise. Changes
Sequence DiagramsequenceDiagram
participant Prefetch as Prefetch State
participant Governor as Adaptive Governor
participant Metrics as Queue Metrics
participant State as Pulse State
participant Dispatch as Pulse Dispatch
Prefetch->>Governor: invoke append_adaptive_queue_governor()
Governor->>Metrics: read previous cycle counters
Governor->>Governor: analyze PR/issue deltas
Governor->>Governor: compute queue_mode<br/>(merge-heavy/pr-heavy/balanced)
Governor->>Governor: calculate focus percentages<br/>(PR_REMEDIATION_FOCUS_PCT,<br/>NEW_ISSUE_DISPATCH_PCT)
Governor->>Metrics: update with current cycle metrics
Governor->>State: write adaptive guidance<br/>+ queue mode + budgets
State->>Dispatch: provide queue mode & budgets
Dispatch->>Dispatch: allocate dispatch capacity<br/>respecting PULSE_QUEUE_MODE
Dispatch->>Dispatch: limit new issues by<br/>AVAILABLE × NEW_ISSUE_DISPATCH_PCT
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
📝 Coding Plan
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: Thu Mar 12 17:11:46 UTC 2026 Generated by AI DevOps Framework Code Review Monitoring |
|
There was a problem hiding this comment.
Code Review
This pull request introduces an adaptive queue-governor to the pulse wrapper and tightens the active worker counting logic. The changes in pulse-wrapper.sh implement the new governor logic, which dynamically adjusts dispatch focus based on PR and issue queue metrics. The documentation in pulse.md is updated accordingly to explain the new adaptive modes and configuration variables. My review focuses on improving the clarity and robustness of the new shell script logic. I've suggested a clearer way to count worker processes and recommended adding a warning if ripgrep (a dependency for the new governor) is not installed, referencing the rule about managing external dependencies in portable shell scripts.
| count_active_workers() { | ||
| local count | ||
| count=$(ps axo command | grep '[/]full-loop' | grep -c '[.]opencode') || count=0 | ||
| count=$(ps axo command | grep '\.opencode run' | grep '/full-loop Implement issue #' | grep -v '/pulse' | grep -c -v grep) || count=0 |
There was a problem hiding this comment.
The use of grep -c -v grep is a bit unconventional for counting processes while excluding the grep command itself. While it works by counting lines that don't contain "grep", a more common and arguably clearer idiom is to use grep -v grep | wc -l or to use the bracket trick in one of the patterns (e.g., grep '[.]opencode') to prevent grep from matching its own process. This would improve readability and maintainability for other developers.
| count=$(ps axo command | grep '\.opencode run' | grep '/full-loop Implement issue #' | grep -v '/pulse' | grep -c -v grep) || count=0 | |
| count=$(ps axo command | grep '\.opencode run' | grep '/full-loop Implement issue #' | grep -v '/pulse' | grep -v grep | wc -l) || count=0 |
| ready_prs=$(rg -c '\[checks: PASS\].*\[review: APPROVED\]' "$STATE_FILE" 2>/dev/null || echo "0") | ||
| failing_prs=$(rg -c '\[checks: FAIL\]|\[review: CHANGES_REQUESTED\]' "$STATE_FILE" 2>/dev/null || echo "0") |
There was a problem hiding this comment.
The script relies on rg (ripgrep) to calculate ready_prs and failing_prs. While it safely defaults to 0 if rg is not found, this can lead to the adaptive governor making suboptimal decisions without any warning to the user. It would be beneficial to explicitly check for rg and log a warning if it's missing, informing the user that the feature's effectiveness is reduced. This aligns with the principle of managing external dependencies in portable shell scripts, ensuring users are aware when non-built-in tools are not available, even if a fallback is in place.
| ready_prs=$(rg -c '\[checks: PASS\].*\[review: APPROVED\]' "$STATE_FILE" 2>/dev/null || echo "0") | |
| failing_prs=$(rg -c '\[checks: FAIL\]|\[review: CHANGES_REQUESTED\]' "$STATE_FILE" 2>/dev/null || echo "0") | |
| if ! command -v rg &>/dev/null; then | |
| echo "[pulse-wrapper] WARNING: ripgrep (rg) not found. Adaptive queue governor metrics for ready/failing PRs will be disabled." >>"$LOGFILE" | |
| ready_prs=0 | |
| failing_prs=0 | |
| else | |
| ready_prs=$(rg -c '\[checks: PASS\].*\[review: APPROVED\]' "$STATE_FILE" 2>/dev/null || echo "0") | |
| failing_prs=$(rg -c '\[checks: FAIL\]|\[review: CHANGES_REQUESTED\]' "$STATE_FILE" 2>/dev/null || echo "0") | |
| fi |
References
- For shell scripts that need to be portable, prefer built-in tools like
grepover external dependencies likejqfor simple tasks, to avoid installation requirements on diverse systems.
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.agents/scripts/commands/pulse.md:
- Around line 55-57: The current assignments for PULSE_QUEUE_MODE,
PR_REMEDIATION_FOCUS_PCT, and NEW_ISSUE_DISPATCH_PCT can capture multiple
matching lines from pulse-state.txt (introducing newlines and breaking
comparisons); update each command that uses grep to select a single value (e.g.,
pipe the grep output to tail -1 to pick the most recent match) before cutting
the value so the variables contain a single scalar string suitable for
comparisons like [[ "$PULSE_QUEUE_MODE" == "pr-heavy" ]].
In @.agents/scripts/pulse-wrapper.sh:
- Around line 1705-1706: Replace the ripgrep calls that set ready_prs and
failing_prs with portable grep invocations: use grep -E -c with the same regex
patterns against "$STATE_FILE" and keep the 2>/dev/null || echo "0" fallback so
missing files still yield "0"; update the lines that assign ready_prs and
failing_prs (referencing those variable names and STATE_FILE) to use grep -E and
the original patterns '\[checks: PASS\].*\[review: APPROVED\]' and '\[checks:
FAIL\]|\[review: CHANGES_REQUESTED\]'.
- Around line 1683-1688: The backfill capacity check in count_active_workers()
is only matching issue workers and undercounts total active workers; update
count_active_workers() to broaden the grep pattern (e.g., match '/full-loop'
while still excluding '/pulse') so it reports all active full-loop workers,
ensuring enforce_utilization_invariants() uses the correct total when comparing
active_workers to max_workers; locate function count_active_workers and change
the grep filter accordingly (or alternatively document/rename it if you intend
it to be issue-only).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 1eae2e18-551d-47da-8a23-8a21d14e1ad1
📒 Files selected for processing (2)
.agents/scripts/commands/pulse.md.agents/scripts/pulse-wrapper.sh
| PULSE_QUEUE_MODE=$(grep '^PULSE_QUEUE_MODE=' ~/.aidevops/logs/pulse-state.txt 2>/dev/null | cut -d= -f2 || echo "balanced") | ||
| PR_REMEDIATION_FOCUS_PCT=$(grep '^PR_REMEDIATION_FOCUS_PCT=' ~/.aidevops/logs/pulse-state.txt 2>/dev/null | cut -d= -f2 || echo 50) | ||
| NEW_ISSUE_DISPATCH_PCT=$(grep '^NEW_ISSUE_DISPATCH_PCT=' ~/.aidevops/logs/pulse-state.txt 2>/dev/null | cut -d= -f2 || echo 50) |
There was a problem hiding this comment.
Multi-value grep returns could break variable comparisons.
If pulse-state.txt contains multiple PULSE_QUEUE_MODE= lines (e.g., from repeated governor calls or file corruption), grep returns all matching lines. The variable then contains newlines, causing string comparisons like [[ "$PULSE_QUEUE_MODE" == "pr-heavy" ]] to fail unexpectedly.
🛡️ Suggested fix using tail -1 to get the last (most recent) value
-PULSE_QUEUE_MODE=$(grep '^PULSE_QUEUE_MODE=' ~/.aidevops/logs/pulse-state.txt 2>/dev/null | cut -d= -f2 || echo "balanced")
-PR_REMEDIATION_FOCUS_PCT=$(grep '^PR_REMEDIATION_FOCUS_PCT=' ~/.aidevops/logs/pulse-state.txt 2>/dev/null | cut -d= -f2 || echo 50)
-NEW_ISSUE_DISPATCH_PCT=$(grep '^NEW_ISSUE_DISPATCH_PCT=' ~/.aidevops/logs/pulse-state.txt 2>/dev/null | cut -d= -f2 || echo 50)
+PULSE_QUEUE_MODE=$(grep '^PULSE_QUEUE_MODE=' ~/.aidevops/logs/pulse-state.txt 2>/dev/null | tail -1 | cut -d= -f2 || echo "balanced")
+PR_REMEDIATION_FOCUS_PCT=$(grep '^PR_REMEDIATION_FOCUS_PCT=' ~/.aidevops/logs/pulse-state.txt 2>/dev/null | tail -1 | cut -d= -f2 || echo 50)
+NEW_ISSUE_DISPATCH_PCT=$(grep '^NEW_ISSUE_DISPATCH_PCT=' ~/.aidevops/logs/pulse-state.txt 2>/dev/null | tail -1 | cut -d= -f2 || echo 50)📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| PULSE_QUEUE_MODE=$(grep '^PULSE_QUEUE_MODE=' ~/.aidevops/logs/pulse-state.txt 2>/dev/null | cut -d= -f2 || echo "balanced") | |
| PR_REMEDIATION_FOCUS_PCT=$(grep '^PR_REMEDIATION_FOCUS_PCT=' ~/.aidevops/logs/pulse-state.txt 2>/dev/null | cut -d= -f2 || echo 50) | |
| NEW_ISSUE_DISPATCH_PCT=$(grep '^NEW_ISSUE_DISPATCH_PCT=' ~/.aidevops/logs/pulse-state.txt 2>/dev/null | cut -d= -f2 || echo 50) | |
| PULSE_QUEUE_MODE=$(grep '^PULSE_QUEUE_MODE=' ~/.aidevops/logs/pulse-state.txt 2>/dev/null | tail -1 | cut -d= -f2 || echo "balanced") | |
| PR_REMEDIATION_FOCUS_PCT=$(grep '^PR_REMEDIATION_FOCUS_PCT=' ~/.aidevops/logs/pulse-state.txt 2>/dev/null | tail -1 | cut -d= -f2 || echo 50) | |
| NEW_ISSUE_DISPATCH_PCT=$(grep '^NEW_ISSUE_DISPATCH_PCT=' ~/.aidevops/logs/pulse-state.txt 2>/dev/null | tail -1 | cut -d= -f2 || echo 50) |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.agents/scripts/commands/pulse.md around lines 55 - 57, The current
assignments for PULSE_QUEUE_MODE, PR_REMEDIATION_FOCUS_PCT, and
NEW_ISSUE_DISPATCH_PCT can capture multiple matching lines from pulse-state.txt
(introducing newlines and breaking comparisons); update each command that uses
grep to select a single value (e.g., pipe the grep output to tail -1 to pick the
most recent match) before cutting the value so the variables contain a single
scalar string suitable for comparisons like [[ "$PULSE_QUEUE_MODE" == "pr-heavy"
]].
| count_active_workers() { | ||
| local count | ||
| count=$(ps axo command | grep '[/]full-loop' | grep -c '[.]opencode') || count=0 | ||
| count=$(ps axo command | grep '\.opencode run' | grep '/full-loop Implement issue #' | grep -v '/pulse' | grep -c -v grep) || count=0 | ||
| echo "$count" | ||
| return 0 | ||
| } |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Check what worker dispatch patterns exist in the codebase
echo "=== Dispatch patterns in pulse.md ==="
rg --no-heading -n '/full-loop' .agents/scripts/commands/pulse.md | head -30
echo ""
echo "=== Mission worker dispatch patterns ==="
rg --no-heading -n 'headless-runtime-helper.sh run' .agents/scripts/commands/pulse.md | head -20
echo ""
echo "=== count_active_workers implementations ==="
rg --no-heading -A5 'count_active_workers\(\)' .agents/scripts/Repository: marcusquinn/aidevops
Length of output: 3918
🏁 Script executed:
#!/bin/bash
# Check how count_active_workers is used in pulse-wrapper.sh
echo "=== Usage of count_active_workers in pulse-wrapper.sh ==="
rg --no-heading -B5 -A5 'count_active_workers\(\)' .agents/scripts/pulse-wrapper.sh | head -50
echo ""
echo "=== MAX_WORKERS and dispatch logic in pulse-wrapper.sh ==="
rg --no-heading -n 'MAX_WORKERS\|WORKER_COUNT\|count_active_workers' .agents/scripts/pulse-wrapper.sh | head -30
echo ""
echo "=== Check if pulse-wrapper.sh dispatches mission workers ==="
rg --no-heading -n 'mission\|Mission' .agents/scripts/pulse-wrapper.sh | head -20Repository: marcusquinn/aidevops
Length of output: 584
🏁 Script executed:
#!/bin/bash
# Search for where count_active_workers is actually called
echo "=== Search for count_active_workers function calls ==="
rg --no-heading -n 'count_active_workers' .agents/scripts/pulse-wrapper.sh
echo ""
echo "=== Check what pulse-wrapper.sh dispatches ==="
rg --no-heading -n 'headless-runtime-helper\|\.opencode run' .agents/scripts/pulse-wrapper.sh | head -20
echo ""
echo "=== Get overall structure/purpose of pulse-wrapper.sh ==="
head -100 .agents/scripts/pulse-wrapper.sh | grep -E '^\#|^[A-Za-z_]+\(\)|script'
echo ""
echo "=== Check if count_active_workers is called anywhere ==="
rg --no-heading -n '\$count_active_workers\|count_active_workers' .agents/scripts/ --type shRepository: marcusquinn/aidevops
Length of output: 3237
🏁 Script executed:
#!/bin/bash
# Check context around line 1954 where count_active_workers is called
echo "=== Context around line 1954 (active_workers=$(count_active_workers)) ==="
sed -n '1945,1975p' .agents/scripts/pulse-wrapper.sh
echo ""
echo "=== Check for any logging or usage of active_workers variable ==="
rg --no-heading -B2 -A2 'active_workers=' .agents/scripts/pulse-wrapper.shRepository: marcusquinn/aidevops
Length of output: 2135
🏁 Script executed:
#!/bin/bash
# Check if mission/PR workers are dispatched from other contexts
echo "=== Check all worker dispatch points ==="
rg --no-heading -n 'headless-runtime-helper.sh run' .agents/scripts/*.sh | grep -v pulse.md
echo ""
echo "=== Check if there's queue enforcement for all worker types ==="
rg --no-heading -B5 -A5 'max_workers\|MAX_WORKERS' .agents/scripts/pulse-wrapper.sh | head -40
echo ""
echo "=== Check purpose/scope comments in pulse-wrapper.sh header ==="
head -50 .agents/scripts/pulse-wrapper.sh | tail -20Repository: marcusquinn/aidevops
Length of output: 1370
🏁 Script executed:
#!/bin/bash
# Check if pulse-wrapper.sh dispatches any workers or just manages the pulse
echo "=== Search for dispatch/worker dispatch in pulse-wrapper.sh ==="
rg --no-heading -n 'dispatch\|queue\|Implement issue' .agents/scripts/pulse-wrapper.sh | head -20
echo ""
echo "=== Check if count_runnable_candidates matches same pattern ==="
rg --no-heading -B2 -A8 'count_runnable_candidates\(\)' .agents/scripts/pulse-wrapper.sh
echo ""
echo "=== Check what queued issues look like ==="
rg --no-heading -B2 -A8 'count_queued_without_worker\(\)' .agents/scripts/pulse-wrapper.shRepository: marcusquinn/aidevops
Length of output: 785
🏁 Script executed:
#!/bin/bash
# Check where mission and PR fix workers are actually dispatched from
echo "=== Check what pulse-wrapper.sh actually calls/dispatches ==="
rg --no-heading -n 'function\|^[a-z_]*() {' .agents/scripts/pulse-wrapper.sh | head -30
echo ""
echo "=== Look for dispatch_* or similar functions in pulse-wrapper ==="
rg --no-heading -B3 -A10 'dispatch\|enqueue' .agents/scripts/pulse-wrapper.sh | head -50
echo ""
echo "=== Check if there's a separate handler for mission/PR workers ==="
ls -la .agents/scripts/*.sh | grep -E 'mission|pr|queue|dispatch'
echo ""
echo "=== Look at mission-dashboard-helper to see if it has its own enforcement ==="
rg --no-heading -n 'max_workers\|count_active_workers' .agents/scripts/mission-dashboard-helper.shRepository: marcusquinn/aidevops
Length of output: 2376
🏁 Script executed:
#!/bin/bash
# Check function definitions without problematic regex
echo "=== Main functions in pulse-wrapper.sh ==="
rg --no-heading -n '^[a-z_]+\(\)' .agents/scripts/pulse-wrapper.sh
echo ""
echo "=== Check if mission-dashboard-helper has worker enforcement ==="
rg --no-heading -B5 -A10 'count_active_workers\|max_workers' .agents/scripts/mission-dashboard-helper.sh | head -50
echo ""
echo "=== Check cron-dispatch.sh for mission/PR dispatch logic ==="
rg --no-heading -n 'mission\|PR\|Address unresolved' .agents/scripts/cron-dispatch.sh | head -20Repository: marcusquinn/aidevops
Length of output: 1220
🏁 Script executed:
#!/bin/bash
# Check what prefetch_active_workers does
echo "=== prefetch_active_workers function ==="
sed -n '880,940p' .agents/scripts/pulse-wrapper.sh
echo ""
echo "=== Check append_adaptive_queue_governor ==="
sed -n '1697,1750p' .agents/scripts/pulse-wrapper.sh
echo ""
echo "=== Check if pulse-wrapper.sh has any worker TYPE distinction ==="
rg --no-heading -n 'issue\|mission\|PR.*fix\|Address unresolved' .agents/scripts/pulse-wrapper.sh | head -20Repository: marcusquinn/aidevops
Length of output: 4408
🏁 Script executed:
#!/bin/bash
# Check if enforce_utilization_invariants actually dispatches workers
echo "=== Full enforce_utilization_invariants function ==="
sed -n '1942,2000p' .agents/scripts/pulse-wrapper.sh
echo ""
echo "=== Check what calls enforce_utilization_invariants ==="
rg --no-heading -n 'enforce_utilization_invariants' .agents/scripts/pulse-wrapper.sh
echo ""
echo "=== Check if pulse-wrapper dispatches PR fix or mission workers ==="
rg --no-heading -B3 -A3 'PR\|mission\|Address unresolved\|Implement.*task' .agents/scripts/pulse-wrapper.sh | head -40Repository: marcusquinn/aidevops
Length of output: 2780
🏁 Script executed:
#!/bin/bash
# Clarify: check if the narrow pattern is intentional by seeing how prefetch_active_workers is used
echo "=== Where is prefetch_active_workers output used? ==="
rg --no-heading -B5 -A5 'prefetch_active_workers' .agents/scripts/pulse-wrapper.sh | grep -v '^--$'
echo ""
echo "=== Check if mission workers or PR fix workers are explicitly SEPARATE from issue workers ==="
rg --no-heading -n 'run_pulse\|count_runnable_candidates\|count_queued_without_worker' .agents/scripts/pulse-wrapper.sh | head -5
echo ""
echo "=== Look at what run_pulse actually does ==="
sed -n '1289,1350p' .agents/scripts/pulse-wrapper.sh
echo ""
echo "=== Check if there's documentation about worker types in pulse.md ==="
head -100 .agents/scripts/commands/pulse.md | tail -50Repository: marcusquinn/aidevops
Length of output: 8189
Backfill capacity check should account for all active worker types, not just issue workers.
The pattern /full-loop Implement issue # counts only issue workers. During backfill, enforce_utilization_invariants() exits when active_workers >= max_workers, but if PR-fix or mission workers are concurrently active, this check undercounts total capacity usage. This could cause the pulse agent to dispatch additional issue workers even when the system has already hit max_workers.
While prefetch_active_workers() correctly shows all /full-loop workers to the pulse agent, the backfill loop's separate capacity gate should match that scope. Consider broadening the pattern to grep '/full-loop' (excluding /pulse to avoid self-counting) or explicitly documenting that backfill is issue-only and relies on the pulse agent's prompt context to enforce cross-worker-type limits.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.agents/scripts/pulse-wrapper.sh around lines 1683 - 1688, The backfill
capacity check in count_active_workers() is only matching issue workers and
undercounts total active workers; update count_active_workers() to broaden the
grep pattern (e.g., match '/full-loop' while still excluding '/pulse') so it
reports all active full-loop workers, ensuring enforce_utilization_invariants()
uses the correct total when comparing active_workers to max_workers; locate
function count_active_workers and change the grep filter accordingly (or
alternatively document/rename it if you intend it to be issue-only).
| ready_prs=$(rg -c '\[checks: PASS\].*\[review: APPROVED\]' "$STATE_FILE" 2>/dev/null || echo "0") | ||
| failing_prs=$(rg -c '\[checks: FAIL\]|\[review: CHANGES_REQUESTED\]' "$STATE_FILE" 2>/dev/null || echo "0") |
There was a problem hiding this comment.
🛠️ Refactor suggestion | 🟠 Major
Use grep instead of rg for consistency and portability.
The script uses grep throughout, but this function introduces a rg (ripgrep) dependency. While the || echo "0" fallback prevents failures when rg is unavailable, it silently returns incorrect counts rather than using the actual data.
♻️ Suggested fix using grep
- ready_prs=$(rg -c '\[checks: PASS\].*\[review: APPROVED\]' "$STATE_FILE" 2>/dev/null || echo "0")
- failing_prs=$(rg -c '\[checks: FAIL\]|\[review: CHANGES_REQUESTED\]' "$STATE_FILE" 2>/dev/null || echo "0")
+ ready_prs=$(grep -cE '\[checks: PASS\].*\[review: APPROVED\]' "$STATE_FILE" 2>/dev/null || echo "0")
+ failing_prs=$(grep -cE '\[checks: FAIL\]|\[review: CHANGES_REQUESTED\]' "$STATE_FILE" 2>/dev/null || echo "0")📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| ready_prs=$(rg -c '\[checks: PASS\].*\[review: APPROVED\]' "$STATE_FILE" 2>/dev/null || echo "0") | |
| failing_prs=$(rg -c '\[checks: FAIL\]|\[review: CHANGES_REQUESTED\]' "$STATE_FILE" 2>/dev/null || echo "0") | |
| ready_prs=$(grep -cE '\[checks: PASS\].*\[review: APPROVED\]' "$STATE_FILE" 2>/dev/null || echo "0") | |
| failing_prs=$(grep -cE '\[checks: FAIL\]|\[review: CHANGES_REQUESTED\]' "$STATE_FILE" 2>/dev/null || echo "0") |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.agents/scripts/pulse-wrapper.sh around lines 1705 - 1706, Replace the
ripgrep calls that set ready_prs and failing_prs with portable grep invocations:
use grep -E -c with the same regex patterns against "$STATE_FILE" and keep the
2>/dev/null || echo "0" fallback so missing files still yield "0"; update the
lines that assign ready_prs and failing_prs (referencing those variable names
and STATE_FILE) to use grep -E and the original patterns '\[checks:
PASS\].*\[review: APPROVED\]' and '\[checks: FAIL\]|\[review:
CHANGES_REQUESTED\]'.



Summary
merge-heavy,pr-heavy,balanced) and recommended PR-vs-issue dispatch focus.opencode run+/full-loop Implement issue #) to avoid supervisor prompt noiseVerification
shellcheck .agents/scripts/pulse-wrapper.shmarkdown-formatter check .agents/scripts/commands/pulse.mdCloses #4217
Summary by CodeRabbit