Repository navigation
fix(review): stop the review's Mutagen daemon during cleanup - #13
Merged
Merged
Conversation
## Short Summary (TL;DR) Cleanup now kills a Mutagen daemon that runs from the review directory. Otherwise it outlives that directory and breaks later Mutagen syncs on the machine. ## The Issue `DDEV_XDG_CONFIG_HOME` isolates the global config, but not the Mutagen daemon. Every ddev build uses `~/.ddev_mutagen_data_directory`, so a review's ddev can start the one shared daemon from `$review_dir/xdg/ddev/bin/mutagen`. Cleanup then deletes `$review_dir`, and the daemon keeps running from the deleted binary. Any later sync, including `TestUploadDirs` and other Mutagen tests, fails with `unable to locate agent bundle (search paths: [<deleted dir>/xdg/ddev/bin])`. The failure looks like a regression in whatever runs next. ## How This PR Solves The Issue The Clean up list gets one item before `$review_dir` is deleted: find a Mutagen process whose binary is under `$review_dir`, and kill that PID. - `lsof -a -d txt -c mutagen` prints each Mutagen process with its binary path. `ps` shows only `mutagen daemon run`, without a path. - `kill` targets the review's own process. `ddev utility mutagen daemon stop` reaches only the daemon that owns the socket, which can be the user's daemon. - DDEV starts a new daemon from the user's binary on its next Mutagen run. ## Manual Testing Instructions ```bash gh pr checkout 13 --repo ddev/agent-skills claude --plugin-dir ./plugins/ddev ``` 1. Run `/ddev:review` on a ddev/ddev PR whose testing starts a project with `performance_mode: mutagen`. 2. Let the review reach the Clean up step. 3. Expect it to kill the daemon whose binary is under `$review_dir`. 4. Run `lsof -a -d txt -c mutagen`. 5. Expect no Mutagen process with a binary under `~/tmp/review-*`. ## Automated Testing Overview No automated tests cover skill text. Claude Code ran `claude plugin validate .` and checked on Linux that the `lsof` command prints a leftover review daemon from a deleted `~/tmp/review-*` directory. Nobody tested the command on macOS. Git Bash on Windows has no `lsof`. 🤖 Developed with assistance from [Claude Code](https://claude.ai/code) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Short Summary (TL;DR)
Cleanup now kills a Mutagen daemon that runs from the review directory. Otherwise it outlives that directory and breaks later Mutagen syncs on the machine.
The Issue
DDEV_XDG_CONFIG_HOMEisolates the global config, but not the Mutagen daemon. Every ddev build uses~/.ddev_mutagen_data_directory, so a review's ddev can start the one shared daemon from$review_dir/xdg/ddev/bin/mutagen. Cleanup then deletes$review_dir, and the daemon keeps running from the deleted binary. Any later sync, includingTestUploadDirsand other Mutagen tests, fails withunable to locate agent bundle (search paths: [<deleted dir>/xdg/ddev/bin]). The failure looks like a regression in whatever runs next.How This PR Solves The Issue
The Clean up list gets one item before
$review_diris deleted: find a Mutagen process whose binary is under$review_dir, and kill that PID.lsof -a -d txt -c mutagenprints each Mutagen process with its binary path.psshows onlymutagen daemon run, without a path.killtargets the review's own process.ddev utility mutagen daemon stopreaches only the daemon that owns the socket, which can be the user's daemon.Manual Testing Instructions
/ddev:reviewon a ddev/ddev PR whose testing starts a project withperformance_mode: mutagen.$review_dir.lsof -a -d txt -c mutagen.~/tmp/review-*.Automated Testing Overview
No automated tests cover skill text. Claude Code ran
claude plugin validate .and checked on Linux that thelsofcommand prints a leftover review daemon from a deleted~/tmp/review-*directory. Nobody tested the command on macOS. Git Bash on Windows has nolsof.🤖 Developed with assistance from Claude Code