Skip to content

fix(review): stop the review's Mutagen daemon during cleanup - #13

Merged
stasadev merged 1 commit into
mainfrom
20261103_stasadev_review_mutagen_daemon
Nov 2, 2026
Merged

stasadev merged 1 commit into
mainfrom
20261103_stasadev_review_mutagen_daemon

Conversation

@stasadev

@stasadev stasadev commented Nov 2, 2026

Copy link
Copy Markdown
Member

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

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

## 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>
@stasadev
stasadev merged commit 3e12114 into main Nov 2, 2026
1 check passed
@stasadev
stasadev deleted the 20261103_stasadev_review_mutagen_daemon branch November 2, 2026 22:45
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.

1 participant