Found by builder bugfix-260 on 2026-08-31 while chasing a single unreproducible test failure.
What happens
Running npx vitest --root packages/codev from a worktree root resolves npx's own cached vitest (4.1.11 in this case) rather than the workspace's pinned 4.1.4. The suite then reports a plain test failure.
The only evidence that the runner changed is the header line: a skewed run prints RUN v4.1.11, a clean one prints RUN v4.1.4. Nothing else says the binary is not the pinned one.
Confirmed by re-running the same tests with packages/codev/node_modules/.bin/vitest: 221 files passed, 4301 tests passed, 0 failed. Under npx the same tree reported 1 failure.
Why it matters
A version skew and a real regression are spelled the same way: one red test. Someone chasing a lone failure will read the assertion, not the header, and go looking for a bug in code that is fine. That cost a builder a round trip today, and it is the kind of hunt that can absorb an afternoon.
It also cuts the other way. A newer runner can pass something the pinned one would fail, so a green under npx is not evidence about the suite this project actually runs.
What would close this
- The suite should refuse to run, or say so loudly, when the runner is not the pinned version. A mismatch is "I am not the thing you meant to run", which needs its own signal rather than arriving as an ordinary failure.
- Contributor docs and any prompt that tells an agent to run tests should name the pinned binary path rather than
npx vitest, so the wrong runner is not the easy default.
Related
#284 is the same family: a tool that could not run spelled the same way as a tool that ran and failed.
Found by builder
bugfix-260on 2026-08-31 while chasing a single unreproducible test failure.What happens
Running
npx vitest --root packages/codevfrom a worktree root resolves npx's own cached vitest (4.1.11 in this case) rather than the workspace's pinned 4.1.4. The suite then reports a plain test failure.The only evidence that the runner changed is the header line: a skewed run prints
RUN v4.1.11, a clean one printsRUN v4.1.4. Nothing else says the binary is not the pinned one.Confirmed by re-running the same tests with
packages/codev/node_modules/.bin/vitest: 221 files passed, 4301 tests passed, 0 failed. Under npx the same tree reported 1 failure.Why it matters
A version skew and a real regression are spelled the same way: one red test. Someone chasing a lone failure will read the assertion, not the header, and go looking for a bug in code that is fine. That cost a builder a round trip today, and it is the kind of hunt that can absorb an afternoon.
It also cuts the other way. A newer runner can pass something the pinned one would fail, so a green under npx is not evidence about the suite this project actually runs.
What would close this
npx vitest, so the wrong runner is not the easy default.Related
#284 is the same family: a tool that could not run spelled the same way as a tool that ran and failed.