Problem → solution
The mcpx dedup audit (this repo's pkgs/mcpx vs the vendored copy in dezren39/nix) found all production code behaviorally identical; the one real divergence was test-only: the nix copy's cancel-while-polling test asserts the daemon spawn actually happened, this copy's didn't. This ports that assertion (see #361 for the full evidence), so this repo — about to become the only mcpx source — loses no coverage when the nix copy is deleted.
TestEnsureDaemonCancelledWhileWaiting now keeps the marker from ensureTestClient and, after the existing error/promptness assertions, waits up to 5s for it, failing with "expected the daemon spawn to have happened before cancellation". The bounded wait mirrors the pattern TestEnsureDaemonNeverReadyStillTimesOut already uses (cmd.Start returns before the child runs; the child is Setsid + Released, so the marker can land after the return).
Verification
go test ./internal/cli/ -run TestEnsureDaemon -count=1 -v: all 5 pass.
- Ablation: with
cmd.Start/Release temporarily stubbed out of EnsureDaemon, the test fails with exactly that message (5.21s); stub reverted.
- Full
go test ./internal/cli/ -count=1: ok (25.2s).
- No production code changes — one test file, +26/−1.
Closes #361. Downstream: dezren39/darwin-nix#468 pins this repo (at the merge rev of this PR) as its mcpx source and deletes its vendored copy.
![Autofix with [code]smith](/api/image?u=https%3A%2F%2Fcamo.githubusercontent.com%2Fef26d88456de9cc93cf03b8611c53675c8af4fc8361b0049e62a133b46e853b6%2F68747470733a2f2f70722d636f6d6d656e74732d6173736574732e626c61636b736d6974682e73682f636f6465736d6974682f6175746f6669782d776974682d636f6465736d6974682d6461726b2e737667)
Need help on this PR? Tag @codesmith-bot with what you need.