t1439: fix pulse status drift and worker cap reporting#4140
t1439: fix pulse status drift and worker cap reporting#4140marcusquinn merged 3 commits intomainfrom
Conversation
🔍 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 11 16:03:37 UTC 2026 Generated by AI DevOps Framework Code Review Monitoring |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughThe PR adds WRAPPER_LOGFILE and updates pulse-session helper to prefer wrapper logs when determining last pulse time (returns "never" if not found). The wrapper script gains a defensive Changes
Sequence Diagram(s)Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
.agents/scripts/pulse-wrapper.sh (1)
58-65: Silent fallback obscures config-helper load failures.The fallback
config_getcorrectly enables graceful degradation when config-helper.sh fails to load, but it activates without any log entry. When this fallback is used,MAX_WORKERS_CAPandQUALITY_DEBT_CAP_PCTsilently revert to hardcoded defaults (8and30), potentially causing subtle behavioral differences that are difficult to diagnose.Consider adding a one-time log entry when the fallback is activated:
♻️ Proposed enhancement for observability
if ! type config_get >/dev/null 2>&1; then + echo "[pulse-wrapper] WARN: config-helper.sh unavailable — using default config values" >>"${HOME}/.aidevops/logs/pulse.log" config_get() { local _key="$1" local default_value="$2" printf '%s\n' "$default_value" return 0 } fiAs per coding guidelines: "Automation scripts - focus on: Clear logging and feedback".
🤖 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 58 - 65, The fallback config_get implementation currently returns defaults silently; modify it to emit a one-time warning when used so callers like MAX_WORKERS_CAP and QUALITY_DEBT_CAP_PCT don't silently fall back: detect when config_get is not available, install the fallback config_get function that prints the default value but also writes a single warning message (to stderr or the script logger) the first time it is invoked (use a static/local flag inside config_get to ensure the log is emitted only once), include the function name "config_get" and mention which keys defaulted when logging to aid debugging.
🤖 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/pulse-session-helper.sh:
- Line 31: The "Starting pulse at" metadata is being written to LOGFILE
(pulse.log) instead of the wrapper-specific WRAPPER_LOGFILE, so update the
pulse-wrapper.sh code that emits that message (the lines that currently echo/log
"Starting pulse at"—search for that exact string) to append to the
WRAPPER_LOGFILE variable instead of LOGFILE; ensure it uses the same append
semantics and directory creation used elsewhere (matching how WRAPPER_LOGFILE is
defined in pulse-session-helper.sh) so wrapper-specific metadata lands in
${WRAPPER_LOGFILE} (not ${LOGFILE}).
---
Nitpick comments:
In @.agents/scripts/pulse-wrapper.sh:
- Around line 58-65: The fallback config_get implementation currently returns
defaults silently; modify it to emit a one-time warning when used so callers
like MAX_WORKERS_CAP and QUALITY_DEBT_CAP_PCT don't silently fall back: detect
when config_get is not available, install the fallback config_get function that
prints the default value but also writes a single warning message (to stderr or
the script logger) the first time it is invoked (use a static/local flag inside
config_get to ensure the log is emitted only once), include the function name
"config_get" and mention which keys defaulted when logging to aid debugging.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: a607c01a-bcbb-4003-a8a6-692d3c9e61a2
📒 Files selected for processing (2)
.agents/scripts/pulse-session-helper.sh.agents/scripts/pulse-wrapper.sh
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 enhances the reliability and robustness of the pulse session management. It addresses issues where pulse status could drift by prioritizing the most recent log data and improves system stability by implementing defensive programming for configuration loading, ensuring critical features like worker capacity reporting remain functional under various conditions. 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
|
|
Dispatching fix worker.
|
There was a problem hiding this comment.
Code Review
This pull request introduces two fixes to improve the reliability of pulse session tracking. First, it addresses status drift by prioritizing the wrapper log over the legacy pulse log, ensuring the latest run metadata is always reflected. Second, it enhances robustness by adding a fallback mechanism for configuration loading, which keeps worker cap reporting available even if helper scripts are missing. The changes are logical and well-implemented. I have one minor suggestion to improve code clarity in the new fallback function.
.agents/scripts/pulse-wrapper.sh
Outdated
| local _key="$1" | ||
| local default_value="$2" |
🔍 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 11 16:48:57 UTC 2026 Generated by AI DevOps Framework Code Review Monitoring |
|
Addressed the remaining CodeRabbit feedback in : the fallback path now emits a one-time warning only when it is actually used, and the message explicitly says default config values are being applied. |
|
Addressed the remaining CodeRabbit feedback in |
🔍 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 11 16:56:20 UTC 2026 Generated by AI DevOps Framework Code Review Monitoring |
|



Summary
Closes #4139
Summary by CodeRabbit