Skip to content

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

Open

Description

@mihar-22

Describe the bug

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:

  • vp pack: <checkout>/node_modules/.pnpm/vite-plus@1.5.0_…/node_modules/vite-plus/dist/pack-bin.js
  • vp build: <checkout>/node_modules/.pnpm/@voidzero-dev+vite-plus-core@1.5.0_…/node_modules/@voidzero-dev/vite-plus-core/dist/vite/bin/vite.js

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.

Reproduction

https://gist.github.com/mihar-22/b1d3bec920bb75e571fccefa533d23c7

Steps to reproduce

  1. Put the gist's files in one folder and run bash repro.sh. It needs pnpm and sqlite3.
  2. 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.
  3. At the second path, vp run copy prints ◉ cache hit, replaying and vp run pack prints ○ cache miss: args changed, executing.
  4. 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

Validations

Activity

  1. voidzero-bot commented on Nov 7, 2026

    @voidzero-bot
    Contributor

    Triage failed unexpectedly (attempt 1 of 3).

    Run: https://github.com/voidzero-dev/vite-plus/actions/runs/42328483401

    I can retry if a new comment provides more information or asks me to try again.

    Error:

    [flue] skill("triage") failed: 401 status code (no body)
    
  2. added theissue type on Nov 7, 2026
  3. mihar-22 commented on Nov 7, 2026

    @mihar-22
    Author

    vp test has the same problem. Its task's stored spawn args hold the absolute path of Vitest's entry in the checkout:

    <checkout-one>/node_modules/.pnpm/vitest@5.1.0_@vitest+browser-preview@5.1.0_@vitest+ui@5.1.0_@voidzero-dev+vite-plus-core@1.5.0/node_modules/vitest/vitest.mjs
    <checkout-two>/node_modules/.pnpm/vitest@5.1.0_@vitest+browser-preview@5.1.0_@vitest+ui@5.1.0_@voidzero-dev+vite-plus-core@1.5.0/node_modules/vitest/vitest.mjs
    

    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 ….

  4. self-assigned this
    on Nov 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

Fields

Priority

None yet

Effort

None yet

Target date

None yet

Start date

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions