Skip to content

fix(mcpx): stop --all builds per-daemon clients from the found daemon's paths - #317

Merged
dezren39 merged 1 commit into
mainfrom
creator/316-stopall-listing-paths
Oct 18, 2026
Merged

dezren39 merged 1 commit into
mainfrom
creator/316-stopall-listing-paths

Conversation

@dezren39

@dezren39 dezren39 commented Oct 18, 2026 •

Copy link
Copy Markdown
Member

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 carry daemon.PathsAt(dir, "") instead of the partial daemon.Paths{State: dir} (empty Info/Cache). PruneStale/ListDaemons read only State, so their behaviour is unchanged.
  • stopAll (:1579): the per-daemon client is built from listing.paths, exactly like CmdDaemons (:1638), instead of the caller's a.Paths with only the socket overridden.

Verification

  • New internal/cli/stopall_test.go:
    • TestAllDaemonsCarriesCompletePathsForFoundDir — a record planted only in the default state dir is listed with Info = <that dir>/daemon.json and a non-empty Cache. Ablation-verified: fails on the pre-fix construction (Info = "", Cache empty), passes after.
    • TestStopAllStopsDaemonFoundInDefaultDir — stop --all sends 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).
  • Full internal/cli (41s) and internal/daemon (89s) suites pass locally; go vet clean; changed files gofmt-clean.

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

Summary by CodeRabbit

  • Bug Fixes
    • Stopping all daemons now uses each daemon’s own paths, so daemons in different state directories can be discovered and shut down correctly.

…'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).
@dezren39
dezren39 requested a review from a team as a code owner October 18, 2026 21:48
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-18T21:50:01.883217Z 3de5bb9 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d4dfb7e1-1992-4186-ba51-0f7b7c883dec
📥 Commits

Reviewing files that changed from the base of the PR and between dea8e0f and 3de5bb9.

📒 Files selected for processing: 2
  • pkgs/mcpx/internal/cli/commands.go
  • pkgs/mcpx/internal/cli/stopall_test.go

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

📝 Walkthrough

Daemon discovery now records complete paths for each state directory. The stop --all command creates each daemon client from the paths associated with that daemon listing. Tests cover discovery and shutdown for a daemon in the default state directory.

Changes: Stop-all path handling

Layer / File(s) Summary
Daemon listing and shutdown paths
pkgs/mcpx/internal/cli/commands.go, pkgs/mcpx/internal/cli/stopall_test.go
allDaemons now uses daemon.PathsAt to create complete paths for each state directory. stopAll uses the paths from each listing when creating a client. Tests verify discovery paths and that stop-all sends one shutdown request to a fake daemon in the default state directory.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 3de5b

This fixes stop --all so it reaches daemons found in the default state directory, and it adds regression tests. No merge-blocking risk is visible in the supplied changes.

Security architecture risk: ⚪ Minimal · up to 3de5b

The change makes each daemon’s path context consistent without expanding which sockets stop-all can contact or weakening existing access controls. No introduced or worsened security concern was identified.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The effective reach remains Unix sockets accessible to the invoking process and referenced by records in the existing discovery directories. This change does not switch stop-all to record-provided TCP endpoints or add cross-service authority.

Trust Boundaries and Controls

  • observed — The local shutdown API relies on Unix-socket filesystem permissions rather than request authentication. Stop-all does not bind its separate health and shutdown operations to the record’s PID or start generation. Both properties predate this PR; retaining the same socket selection and request sequence does not introduce or worsen them.

Resilience and Maintainability Implications

  • observed — Shutdown cleanup remains daemon-owned: persistence and server shutdown precede removal of the socket and primary or mirrored records. The new fake-daemon test verifies one shutdown and observed socket termination, but does not exercise real cleanup, interruption, repetition, or concurrent replacement.
Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Linked Issues check Warning The changes in pkgs/mcpx implement the requested local behavior. allDaemons now uses daemon.PathsAt(dir, ""). stopAll now uses listing.paths. The new tests cover complete paths and shutdown … Apply the same allDaemons and stopAll changes and regression tests to the dezren39/nix mcpx copy. Provide evidence that the required internal/cli and internal/daemon suites pass in both repositories.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: stop --all now builds each client from the paths of the discovered daemon.
Out of Scope Changes check Passed The two source changes and the new tests directly implement #316. The tests validate daemon discovery paths and stop --all shutdown behavior. No unrelated product changes appear in the whole-PR diff…
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 2 files.
Full details: Out of Scope Changes check

Explanation

The two source changes and the new tests directly implement #316. The tests validate daemon discovery paths and stop --all shutdown behavior. No unrelated product changes appear in the whole-PR diff.

Full details: Linked Issues check

Explanation

The changes in pkgs/mcpx implement the requested local behavior. allDaemons now uses daemon.PathsAt(dir, ""). stopAll now uses listing.paths. The new tests cover complete paths and shutdown through the found socket. However, #316 requires the identical fix and regression coverage in both mcpx copies, plus the internal/cli and internal/daemon suites in both repositories. The whole-PR diff contains only the pkgs/mcpx copy. The PR description's reference to another PR does not establish that the second copy contains the fix or that its suites pass.

Resolution

Apply the same allDaemons and stopAll changes and regression tests to the dezren39/nix mcpx copy. Provide evidence that the required internal/cli and internal/daemon suites pass in both repositories.

  • Fix all pre-merge checks with AI
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@dezren39
dezren39 merged commit 467c114 into main Oct 18, 2026
17 checks passed
@dezren39
dezren39 deleted the creator/316-stopall-listing-paths branch October 18, 2026 21:57
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.

mcpx: stop --all builds its per-daemon clients from the caller's paths, not the found daemon's (both mcpx copies)

1 participant