Skip to content

t1467: recycle stale pulse process when underfilled#4326

Merged
alex-solovyev merged 1 commit intomainfrom
bugfix/pulse-stale-underfill-recovery
Mar 13, 2026
Merged

t1467: recycle stale pulse process when underfilled#4326
alex-solovyev merged 1 commit intomainfrom
bugfix/pulse-stale-underfill-recovery

Conversation

@marcusquinn
Copy link
Owner

@marcusquinn marcusquinn commented Mar 13, 2026

Summary

  • Add PULSE_UNDERFILLED_STALE_RECOVERY_TIMEOUT (default 900s) to pulse-wrapper.sh.
  • Extend check_dedup() to recycle a running pulse process early when it is old enough and worker utilization is under target.
  • Keep existing hard stale-threshold behavior unchanged; this only accelerates recovery in underfilled conditions.

Verification

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

Closes #4325
Refs #4311

Summary by CodeRabbit

  • New Features
    • Implemented intelligent automatic background process recovery that continuously monitors system resource availability and intelligently recycles underutilized or stale processes when capacity becomes available, ensuring optimal performance. This enhancement significantly improves system stability, responsiveness, operational efficiency, and resource utilization across all operations. Also includes configurable timeout settings for customizing recovery behavior to match workload needs.

@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

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 7d944fb2-0c77-4b84-864c-2deefb39ccef

📥 Commits

Reviewing files that changed from the base of the PR and between 04ede67 and 8ac2da0.

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

Walkthrough

This PR adds a stale process auto-recovery mechanism to the pulse dedup logic. It introduces a new configurable timeout (PULSE_UNDERFILLED_STALE_RECOVERY_TIMEOUT) and implements an early recycling pathway that detects long-running pulse processes with insufficient active workers, triggering their controlled termination and PID cleanup.

Changes

Cohort / File(s) Summary
Pulse Dedup Recovery
.agents/scripts/pulse-wrapper.sh
Adds PULSE_UNDERFILLED_STALE_RECOVERY_TIMEOUT configuration parameter with numeric validation. Inserts new early-recycle branch in check_dedup that monitors pulse runtime and active worker count; triggers forced termination and PID cleanup when pulse runs longer than timeout threshold with insufficient active workers relative to max target. Preserves existing dedup logic flow.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested labels

bug

Poem

🔄 A stale pulse sleeps too long,

When workers fade and timeout songs,

The wrapper wakes and sets it free—

Early recycle, swift and clean! 🧹

✨ 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-stale-underfill-recovery
📝 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

🔍 Code Quality Report

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

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

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

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 411
  • VULNERABILITIES: 0

Generated on: Fri Mar 13 02:34:40 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

@alex-solovyev alex-solovyev merged commit a391801 into main Mar 13, 2026
16 of 18 checks passed
@alex-solovyev alex-solovyev deleted the bugfix/pulse-stale-underfill-recovery branch March 13, 2026 02:35
@sonarqubecloud
Copy link

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.

t1467: Add underfilled stale-process auto-recovery in pulse dedup

2 participants