Skip to content

t1463: prevent cold-start false idle kills in pulse watchdog#4312

Merged
marcusquinn merged 1 commit intomainfrom
bugfix/pulse-idle-watchdog-autonomy
Mar 13, 2026
Merged

t1463: prevent cold-start false idle kills in pulse watchdog#4312
marcusquinn merged 1 commit intomainfrom
bugfix/pulse-idle-watchdog-autonomy

Conversation

@marcusquinn
Copy link
Owner

@marcusquinn marcusquinn commented Mar 13, 2026

Summary

  • Add a cold-start watchdog timeout (PULSE_COLD_START_TIMEOUT, default 1200s) so pulse sessions get a longer first-output grace window before stall kill decisions.
  • Reorder watchdog checks to evaluate log progress first, then apply CPU idle enforcement only after at least one output/progress event.
  • Keep existing stuck-process protection after first progress: standard PULSE_PROGRESS_TIMEOUT and PULSE_IDLE_TIMEOUT continue to guard post-start stalls.

Verification

  • shellcheck .agents/scripts/pulse-wrapper.sh
  • bash -n .agents/scripts/pulse-wrapper.sh

Closes #4311
Refs #4261

Summary by CodeRabbit

Release Notes

  • Bug Fixes
    • Enhanced process watchdog monitoring to more accurately distinguish application startup phases from normal operation, reducing false positive alerts.
    • Improved progress tracking and idle detection with better sequencing to prevent monitoring errors during early execution and ensure more reliable process supervision.

@gemini-code-assist
Copy link

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 13, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 4ee08e46-d506-4e0a-918f-eb42f8716d50

📥 Commits

Reviewing files that changed from the base of the PR and between 3c953dd and f62b507.

📒 Files selected for processing (1)
  • .agents/scripts/pulse-wrapper.sh

Walkthrough

The pulse wrapper's watchdog timeout logic is refactored to distinguish between cold-start and post-start phases. A new PULSE_COLD_START_TIMEOUT configuration and has_seen_progress flag enable separate deadlines before initial output. Idle detection now occurs only after the first progress event, preventing false idle kills during startup.

Changes

Cohort / File(s) Summary
Pulse Watchdog Timing Logic
.agents/scripts/pulse-wrapper.sh
Added PULSE_COLD_START_TIMEOUT configuration with validation; introduced has_seen_progress state flag to track first output occurrence; refactored watchdog ordering to apply cold-start timeouts until progress detected, then switch to post-start timeouts; idle CPU-based detection now requires prior progress observation to avoid false positives during startup.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

Suggested labels

bug

Poem

🕐 Cold starts no longer stumble in the dark,
A patient watchdog now waits for the spark,
Progress unlocks the idle-check gate,
No false alarms before processes wake—
Two-phase timing keeps jobs running straight! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: preventing cold-start false idle kills in the pulse watchdog, which directly matches the PR's primary objective.
Linked Issues check ✅ Passed The PR successfully implements the core requirement from #4311: differentiating cold-start inactivity from genuine stalls by introducing PULSE_COLD_START_TIMEOUT and reordering watchdog checks to run post-first-output.
Out of Scope Changes check ✅ Passed All changes are directly related to the cold-start watchdog timeout feature; no unrelated modifications detected outside the scope of fixing false idle kills.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch bugfix/pulse-idle-watchdog-autonomy
📝 Coding Plan
  • Generate coding plan for human review comments

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Contributor

🔍 Code Quality Report

�[0;35m[MONITOR]�[0m Code Review Monitoring Report

�[0;34m[INFO]�[0m Latest Quality Status:
SonarCloud: 0 bugs, 0 vulnerabilities, 407 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Fri Mar 13 01:17:01 UTC 2026: Code review monitoring started
Fri Mar 13 01:17:02 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 407

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 407
  • VULNERABILITIES: 0

Generated on: Fri Mar 13 01:17:04 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

@sonarqubecloud
Copy link

@marcusquinn marcusquinn merged commit 9fc9a2f into main Mar 13, 2026
27 checks passed
@marcusquinn marcusquinn deleted the bugfix/pulse-idle-watchdog-autonomy branch March 13, 2026 01:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

t1463: Fix pulse watchdog false idle kills before first output

1 participant