You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Built-in tasks such as vp pack and vp build miss the task cache at another checkout path: their keys hold the absolute path of Vite+'s entry script #3374
A task whose command is a Vite+ built-in, such as vp pack or vp build, misses the task cache whenever the project sits at another path, even when nothing it reads changed. The miss reason is args changed. The stored key's args hold the absolute path of Vite+'s own entry script inside that checkout's node_modules:
A plain task (node copy.mjs) with the same inputs replays at the second path, so only the built-in's path is the difference.
I expect a built-in task's key to name its entry relative to the workspace, or by the tool's package and version, so two checkouts of one commit share results.
Why it matters: git worktrees, several agents working on one machine each in its own checkout, and machines sharing one remote cache all run the same commit from different paths. In a workspace with 12 build tasks, a second worktree reading from a shared remote cache replayed 1 of 12. The one that hit was a package script, not a built-in.
This looks like the Vite+ side of voidzero-dev/vite-task#790, whose fix, voidzero-dev/vite-task#789, adds tool_entry to synthesized commands but notes that nothing sets it yet: Vite+ would pass the entry it resolves for each built-in tool. voidzero-dev/vite-task#717 is the same key field for entries in a global pnpm store. The tracked OXLINT_TSGOLINT_PATH env that #717 names is a second absolute path, for vp lint.
Put the gist's files in one folder and run bash repro.sh. It needs pnpm and sqlite3.
It creates a project in a temporary folder, runs vp run pack and vp run copy, then copies the project, with its node_modules/.vite/task-cache, to a second path and runs both again.
At the second path, vp run copy prints ◉ cache hit, replaying and vp run pack prints ○ cache miss: args changed, executing.
The script then prints the pack-bin.js path from each stored key. They differ only in the checkout's folder.
System Info
# No global vp installed; this is the project's local CLI.
$ vp --version
vp v1.5.0
Local vite-plus:
vite-plus v1.5.0
Tools:
vite v8.3.5
rolldown v1.2.16
vitest v5.1.0
oxfmt v0.76.0
oxlint v1.91.0
oxlint-tsgolint v7.0.2005
tsdown v0.23.4
Node.js v26.12.0, pnpm 12.14.0, Linux x64
Used Package Manager
pnpm
Logs
# At the second path:
$ node copy.mjs ◉ cache hit, replaying
vp run: cache hit, 25ms saved.
$ vp pack ○ cache miss: args changed, executing
# The pack-bin.js path in each stored key:
/tmp/tmp.XXXX/a/node_modules/.pnpm/vite-plus@1.5.0_@vitest+ui@5.1.0/node_modules/vite-plus/dist/pack-bin.js
/tmp/tmp.XXXX/b/node_modules/.pnpm/vite-plus@1.5.0_@vitest+ui@5.1.0/node_modules/vite-plus/dist/pack-bin.js
Reproduced on 1.5.0 with the gist above, plus a test: { command: 'vp test run', cache: { input: ['src/**'] } } task and one test file: run it, copy the project to a second path, run it again, and it misses on args changed. The same command run as node node_modules/vite-plus/bin/vp test run hits at the second path, since the key then holds the relative path.
We also see vp check and vp lint keys hold <checkout>/node_modules/.pnpm/oxlint@…/node_modules/oxlint/bin/oxlint. For now we run every cached built-in through node node_modules/vite-plus/bin/vp ….
Once that’s done, we’ll update the vite-task dependency in Vite+ and set the tool_entry for each built-in tool. This allows vite-task to use a path relative to the task's working directory in the cache key.
We’ve decided not to handle this fix entirely within Vite+ for now. If we did, Vite+ would need to manually find and rewrite the entry script in args. Since #789 handles that exact logic inside vite-task, any temporary code we wrote here would just end up being removed later.
Just a heads-up that #789 doesn’t address the absolute path in OXLINT_TSGOLINT_PATH for vp lint. That part is being tracked over in voidzero-dev/vite-task#717.
Activity
voidzero-bot commentedon Nov 7, 2026
mihar-22 commentedon Nov 7, 2026
vp testhas the same problem. Its task's stored spawn args hold the absolute path of Vitest's entry in the checkout:Reproduced on 1.5.0 with the gist above, plus a
test: { command: 'vp test run', cache: { input: ['src/**'] } }task and one test file: run it, copy the project to a second path, run it again, and it misses onargs changed. The same command run asnode node_modules/vite-plus/bin/vp test runhits at the second path, since the key then holds the relative path.We also see
vp checkandvp lintkeys hold<checkout>/node_modules/.pnpm/oxlint@…/node_modules/oxlint/bin/oxlint. For now we run every cached built-in throughnode node_modules/vite-plus/bin/vp ….naokihaba commentedon Nov 18, 2026
This fix is currently waiting on voidzero-dev/vite-task#789 to be merged.
Once that’s done, we’ll update the vite-task dependency in Vite+ and set the
tool_entryfor each built-in tool. This allows vite-task to use a path relative to the task's working directory in the cache key.We’ve decided not to handle this fix entirely within Vite+ for now. If we did, Vite+ would need to manually find and rewrite the entry script in
args. Since #789 handles that exact logic inside vite-task, any temporary code we wrote here would just end up being removed later.Just a heads-up that #789 doesn’t address the absolute path in
OXLINT_TSGOLINT_PATHforvp lint. That part is being tracked over in voidzero-dev/vite-task#717.