Repository navigation
fix(mcpx): stop --all builds per-daemon clients from the found daemon's paths - #317
Merged
Merged
Conversation
…'s paths
stopAll used the caller's Paths (only the socket overridden) while
CmdDaemons used the listing's paths for the same daemon records, and
allDaemons built those listing paths as a partial Paths{State: dir}
with Info/Cache empty. Listings now carry a complete PathsAt(dir)
and stopAll builds its client from the listing, like CmdDaemons.
New stopall_test.go: allDaemons carries complete paths for a daemon
found only in the default state dir (fails pre-fix), and stop --all
stops a fake daemon serving on that record's socket.
Fixes #316 (same change lands in dezren39/nix,
whose pkgs/mcpx is vendored from this repo).
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. |
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 #316 — the cross-repo set for both mcpx copies (the dezren39/nix PR references this issue by URL, per the one-issue-per-set rule).
Change (2 lines + tests)
allDaemons(internal/cli/commands.go:1554): listings now carrydaemon.PathsAt(dir, "")instead of the partialdaemon.Paths{State: dir}(emptyInfo/Cache).PruneStale/ListDaemonsread onlyState, so their behaviour is unchanged.stopAll(:1579): the per-daemon client is built fromlisting.paths, exactly likeCmdDaemons(:1638), instead of the caller'sa.Pathswith only the socket overridden.Verification
internal/cli/stopall_test.go:TestAllDaemonsCarriesCompletePathsForFoundDir— a record planted only in the default state dir is listed withInfo = <that dir>/daemon.jsonand a non-emptyCache. Ablation-verified: fails on the pre-fix construction (Info = "",Cacheempty), passes after.TestStopAllStopsDaemonFoundInDefaultDir—stop --allsends exactly one shutdown to a fake daemon serving HTTP over the record's unix socket in the default dir (this command had no tests at all).internal/cli(41s) andinternal/daemon(89s) suites pass locally;go vetclean; changed files gofmt-clean.Need help on this PR? Tag
@codesmith-botwith what you need.Summary by CodeRabbit