Repository navigation
mcpx daemons: prune dead records, find daemons in other state dirs - #279
Merged
Merged
Conversation
…ixes #278) Port of dezren39/nix PR #381 (fix for dezren39/darwin-nix#369), whose pre-fix files were byte-identical to this repo's pkgs/mcpx copies; issue references re-pointed to #278. - PruneStale: daemon records whose process is gone are removed from disk and from the listing; a killed daemon no longer shows forever with RUNNING false. ProcessAlive mirrors pool.keyPIDAlive (signal 0, EPERM counts as alive); records with no pid are kept. - A daemon in a custom state directory mirrors its record into the default state directory (WriteInfo/RemoveInfo), and 'mcpx daemons' and 'stop --all' search both directories, deduped by socket. The help promise 'every daemon on this machine' now holds for daemons started after this change. - paths.config entries that name a file now warn in adoptSettings, naming --config/MCPX_CONFIG as the way to pick a file, instead of being silently ignored. paths.config leaves the settings consumed-test allowlist accordingly. - Regenerate docs/parity.md for the daemons help text. Tests: new daemon tests for ProcessAlive, PruneStale and the mirror; full internal/daemon, internal/settings and internal/cli suites pass. Verified end-to-end with a built binary: a dead record is pruned by 'mcpx daemons', a custom-state daemon's mirror is listed and stopped from another state dir, and the paths.config warning fires where the pre-fix binary stayed silent.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
📒 Files selected for processing: 9
✨ Finishing Touches
Comment |
added 2 commits
October 18, 2026 06:45
Two formatting traps this change trips over, both pre-existing on main: - manual.go had a struct field misaligned by one space; treefmt checks whole changed files, so touching the file surfaces it. gofmt only. - docs/parity.md is generated, and TestParityDocumentIsCurrent compares it byte-for-byte with the generator's output. Prettier (treefmt's md formatter) pads its tables, which the test can never accept -- main's parity.md was already prettier-dirty for this reason, and any PR regenerating it would fail one check or the other. Exclude the one generated file from treefmt, like pkgs/id and pkgs/dht already are.
4 tasks
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.
Fixes #278 — ports dezren39/nix PR #381 (the fix for dezren39/darwin-nix#369) to this repo's
pkgs/mcpxcopy, whose pre-fix files were verified byte-identical to nix's pre-fix versions (issue references re-pointed to #278).ProcessAlivemirrorspool.keyPIDAlive(signal 0, EPERM counts as alive); records with no pid are kept.WriteInfo/RemoveInfo), andmcpx daemonsandstop --allsearch both directories, deduped by socket.adoptSettings, naming--config/MCPX_CONFIG, instead of being silently ignored;paths.configleaves the settings consumed-test allowlist.docs/parity.mdregenerated for the daemons help text.Verification:
internal/daemon,internal/settingsandinternal/clisuites pass;go build ./...andgo vetclean.PruneStalemakes the new prune test fail; restored it passes.mcpx daemons(file removed); a daemon started in a custom state dir writes a mirror into the default dir, is listed and stopped from a third state dir, and shutdown removes both records; thepaths.configfile-entry warning fires where the pre-fix binary stayed silent.Summary by CodeRabbit
daemonscommand now finds daemon records across the machine, including daemons using custom state directories. Records are mirrored to the default location, so these daemons are included in listings and stop-all operations.paths.configentry points to a file instead of a directory, with guidance on other configuration options.