Skip to content

t5136: Fix pulse-wrapper.sh to use neutral PULSE_DIR, prevent session accumulation#5137

Merged
alex-solovyev merged 1 commit intomainfrom
bugfix/t5136-pulse-dir-neutral
Mar 17, 2026
Merged

t5136: Fix pulse-wrapper.sh to use neutral PULSE_DIR, prevent session accumulation#5137
alex-solovyev merged 1 commit intomainfrom
bugfix/t5136-pulse-dir-neutral

Conversation

@alex-solovyev
Copy link
Collaborator

@alex-solovyev alex-solovyev commented Mar 17, 2026

Summary

  • Change PULSE_DIR default from ~/Git/aidevops to ~/.aidevops/.agent-workspace/ — a neutral path not associated with any managed repo
  • Update setup.sh launchd plist and cron job to use the neutral workspace path instead of the aidevops repo directory
  • Document why session reuse is intentionally disabled for pulse role (stale context prevention from PR t1435: keep pulse sessions fresh and canonical #4129)

Problem

When a repo has pulse: false in repos.json, the pulse supervisor still ran FROM that repo's directory (via PULSE_DIR default), creating 155+ orphaned "Supervisor Pulse" sessions associated with the wrong project in ~36 hours. Two root causes:

  1. Misleading project associationPULSE_DIR defaulted to ~/Git/aidevops in both pulse-wrapper.sh (line 214) and setup.sh (launchd/cron env vars). Sessions were filed under that project even with pulse: false.
  2. Session accumulation — Session reuse was intentionally disabled for pulse role in PR t1435: keep pulse sessions fresh and canonical #4129 (headless-runtime-helper.sh clears session ID each cycle to prevent stale conversational context from contaminating dispatch decisions). Each cycle creates a fresh session by design.

Fix

The supervisor is a framework-level process, not a project-level one. Using ~/.aidevops/.agent-workspace/ as the working directory means pulse sessions are filed under the framework workspace rather than polluting any specific project's session list. Sessions are still created each cycle (by design), but they no longer accumulate under a managed repo.

Note for existing installations: Users need to run aidevops update (which re-runs setup.sh) to regenerate the launchd plist or cron job with the new PULSE_DIR value. Until then, the old env var from launchd/cron will override the new default in pulse-wrapper.sh.

Closes #5136

Summary by CodeRabbit

  • Chores
    • Pulse workspace sessions now utilize a centralized workspace directory independent of specific repositories. Updated workspace initialization to ensure proper directory creation and setup, enhancing portability and configuration consistency. Sessions are managed independently per cycle from this neutral workspace location.

…alse repos

PULSE_DIR defaulted to ~/Git/aidevops, causing the host app to associate
all supervisor pulse sessions with that project — even when it had
pulse:false in repos.json. This created 155+ orphaned sessions in ~36h.

Root causes:
1. pulse-wrapper.sh hardcoded PULSE_DIR to ~/Git/aidevops (line 214)
2. setup.sh explicitly set PULSE_DIR to the aidevops repo path in both
   launchd plist and cron job environment variables
3. Session reuse was intentionally disabled for pulse role in PR #4129
   (headless-runtime-helper.sh clears session ID each cycle to avoid
   stale context), so each cycle creates a fresh session — by design

Fix:
- Change PULSE_DIR default to ~/.aidevops/.agent-workspace/ (neutral path
  not associated with any managed repo)
- Update setup.sh launchd plist and cron job to use the neutral path
- Add mkdir -p for PULSE_DIR to ensure the directory exists
- Document why session reuse is disabled (stale context prevention)

The supervisor is a framework-level process, not a project-level one.
Using a neutral workspace path means pulse sessions are filed under the
framework workspace rather than polluting any specific project's session
list.

Closes #5136
@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!

@github-actions github-actions bot added the bug Auto-created from TODO.md tag label Mar 17, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 17, 2026

Caution

Review failed

Pull request was closed or merged during review

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: 1c46ee0a-c301-4558-a099-b770d2c1986c

📥 Commits

Reviewing files that changed from the base of the PR and between d6dc668 and 804f1ec.

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

Walkthrough

The pull request decouples Pulse sessions from repository-specific paths by replacing the PULSE_DIR default from a managed repository location to a neutral workspace directory at ${HOME}/.aidevops/.agent-workspace. This change updates both the wrapper script and setup configuration across macOS and Linux environments.

Changes

Cohort / File(s) Summary
Pulse Wrapper Script
.agents/scripts/pulse-wrapper.sh
Updated default PULSE_DIR from ~/Git/aidevops to neutral workspace path. Added directory creation with mkdir -p during setup. Updated comments to clarify workspace-neutral Pulse session handling.
Setup Configuration
setup.sh
Replaced PULSE_DIR computation to use neutral workspace path instead of resolved main worktree directory. Updated XML/plist and crontab generation to reference new PULSE_DIR variable. Refactored local variable declarations and updated supporting comments referencing GH#5136.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

Pulse floats free from repo chains,
A neutral workspace now reigns,
No Git path locks it down,
Sessions dance through workspace town,
DevOps automation, duty found! 🚀

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 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 summarizes the main change: moving PULSE_DIR to a neutral workspace path to prevent session accumulation. It directly reflects the core problem being solved.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ 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
  • Commit unit tests in branch bugfix/t5136-pulse-dir-neutral
📝 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, 467 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Tue Mar 17 01:36:25 UTC 2026: Code review monitoring started
Tue Mar 17 01:36:25 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 467

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 467
  • VULNERABILITIES: 0

Generated on: Tue Mar 17 01:36:28 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

@sonarqubecloud
Copy link

@alex-solovyev alex-solovyev merged commit f50d5cf into main Mar 17, 2026
28 of 29 checks passed
@alex-solovyev alex-solovyev deleted the bugfix/t5136-pulse-dir-neutral branch March 17, 2026 01:41
@marcusquinn marcusquinn added the review-feedback-scanned Merged PR already scanned for quality feedback label Mar 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Auto-created from TODO.md tag review-feedback-scanned Merged PR already scanned for quality feedback

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pulse supervisor creates session accumulation and misleading project association when repo has pulse: false

2 participants