Repository navigation
Description
Describe the bug
A cached vp check task misses its cache when a new gitignored folder (here coverage/) appears in the workspace root, even though vp check never reads anything in it:
$ vp check ○ cache miss: 'coverage' added in workspace root, executingvp check lists the workspace root, and automatic file tracking fingerprints that directory listing.
It does not take into account that fmt and lint ignore the entry by themselves because of the .gitignore file.
In a monorepo this happens in every package: each package's vp check lists the workspace root too, so vp test --coverage creating coverage/ at the root makes every package's check run again:
~/packages/core$ vp check ○ cache miss: 'coverage' added in workspace root, executing
~/packages/plugin-native$ vp check ○ cache miss: 'coverage' added in workspace root, executing
...The only 2 ways around it today are :
- prevent coverage folder deletion (just empty it) and a run.tasks check entry with
{ command: "vp check", cache: { input: [{ auto: true }, "!coverage/**"] }}in the root vite.config.ts, - or a run.tasks entry with cache.input: [{ auto: true }, { pattern: "!coverage/**", base: "workspace" }] in every package that has a check script, because cache.input can't be set on package.json scripts.
What I expect: a path that vp check ignores does not affect its cache. vp build and vp test already report paths to leave out through cooperative tracking, and vp check could do the same with its ignore patterns (or file tracking could skip gitignored names when fingerprinting a directory listing).
Reproduction
See steps to reproduce
Steps to reproduce
Complete reproduction steps:
vp create vite:monorepo --directory vp-check-cache-repro --no-interactive --package-manager bun
cd vp-check-cache-repro
echo coverage >> .gitignore
vp run ready # first run
vp run ready # vp check misses: 'dist' added in 'apps/website'
vp run ready # 5/5 cache hit
mkdir coverage
vp run ready # vp check misses: 'coverage' added in workspace root (4/5 hit)Or, straight to the point:
vp run check # cache miss (first run)
vp run check # cache hit
mkdir coverage
vp run check # cache miss: 'coverage' added in workspace rootSystem Info
`vp env current`:
Node.js:
Version 26.13.1
Source .node-version
Bin Path /[...]/.vite-plus/js_runtime/node/26.13.1/bin/node
Installed true
Mode managed
Package Manager:
Name bun
Version 1.4.4
Source packageManager
Bin Paths
bun /[...]/.vite-plus/package_manager/bun/1.4.4/bun/bin/bun
bunx /[...]/.vite-plus/package_manager/bun/1.4.4/bun/bin/bunx
Installed true
Mode managed
`vp --version`:
vp v1.8.0
Local vite-plus:
vite-plus v1.8.0
Tools:
vite v8.3.8
rolldown v1.2.19
vitest v5.1.1
oxfmt v0.79.0
oxlint v1.94.0
tsrs v7.1.0-beta.tsrs4
tsdown v0.23.4
Environment:
Package manager bun v1.4.4
Node.js v26.13.1 (.node-version)Used Package Manager
bun
Logs
$ vp run check
$ vp check ○ cache miss: 'coverage' added in workspace root, executingValidations
- Read the Contributing Guidelines.
- Check that there isn't already an issue for the same bug.
- Confirm this is a Vite+ issue and not an upstream issue (Vite, Vitest, tsdown, Rolldown, or Oxc).
- The provided reproduction is a minimal reproducible example.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Start date
Target date
Effort
Activity
voidzero-bot commentedon Nov 25, 2026
○ cache miss: 'coverage' added in workspace root, executing) on currentmainin a freshvp create vite:monorepoproject.vite-taskcrate, which is a git dependency here).vp checkin any project that produces a gitignoredcoverage/), and there is a documented, straightforward workaround (cache.inputwith{ auto: true }plus a!coverage/**negative glob), matching the "When To Add Manual Config" guidance in our docs.When
vp run checkcaches thecheckscript, the Vite Task runner's syscall-level tracking records the workspace-root directory listing that oxfmt/oxlint perform while scanning. That listing is fingerprinted verbatim (DirListing.entriesincrates/vt/src/session/execute/fingerprint.rsin the upstream vite-task crate) with no.gitignoreawareness — I confirmed the stored fingerprint in the reproduction's cache DB literally containscoverageas a tracked entry — so the folder's appearance is an input change.vp checknever reports its ignored paths through cooperative tracking (ignoreInput); today onlyvp buildandvp testdo (e.g. the Vitest cache-path plugin inpackages/cli/src/define-config.ts). Verification found this default is deliberate: upstream PR voidzero-dev/vite-task#919 removed blanket entry-skipping from listings because hidden entries can replay stale output, and maintainer-authored upstream issue voidzero-dev/vite-task#992 documents this exact gitignore behavior with an opt-in proposal outstanding.I wasn't able to find a fix, but I identified some areas that may be relevant. Two candidate directions, both aligned with the issue's own suggestions: (1) upstream, in vite-task's
crates/vt/src/session/execute/fingerprint.rs(create/input_changes/DirListing) — the opt-in gitignore-aware listing mode drafted in vite-task#992; (2) in this repo, havingvp checkreport ignored paths via the cooperative-tracking IPC (vt_client::Client::ignore_input, reachable fromexecute_checkinpackages/cli/binding/src/check/mod.rs), mirroringvitePlusVitestCachePathsPlugin— the docs already promise extending cooperative tracking "to more first-party tools in the future". Until then, the negative-glob workaround the reporter found remains the sanctioned path.Full Triage Report
Triage Report — Issue #3579
Issue summary
vp runcache misses forvp checkwhen a gitignored folder is added to the workspace rootvp checkignores (gitignored, e.g.coverage/) must not affect its task cache; the secondvp run checkaftermkdir coverageshould stay a cache hit.checkscript (vp check) fingerprints the workspace-root directory listing without honoring.gitignore, so a new gitignored folder causes○ cache miss: 'coverage' added in workspace root, executing.Environment
/home/runner/work/vite-plus/vite-plus(branchtriagebot/fix-3579, currentmain)vpv1.8.0 installed from this checkout, onPATHvite-plus1.8.0 packed from the checkout via the local npm registryReproduction path
/tmp/vite-plus-triage/gh-3579/repro/vp-check-cache-reproScaffolded a monorepo through the local registry (matches the report, pnpm instead of bun — package manager is irrelevant to the cache-fingerprint bug):
(exit 0; scaffolded with
apps/websiteandpackages/utils, root scriptready, package scriptcheck: vp check)git init,echo coverage >> .gitignore, commit (verified withgit check-ignore coverage).Added a root
"check": "vp check"script (the template's root has nocheckscript; the report's project does) to mirrorvp run checkfrom the report.Commands and results
Attempt 1 (abandoned): minimal hand-made project with
pnpm linkto the checkoutvp checklinted files reachable through the symlink into the checkout'snode_modules(thousands of oxlint findings), exit 1 — noise caused by linking, not the reported bug. Switched to the local-registry scaffold above.Attempt 2 (successful): root
checkscript — exact reported triggerExit code 0 in all runs; the third run is a cache miss with the exact message from the issue log.
Additional data points:
touch coverage/lcov.info, i.e. whatvp test --coverageproduces):○ cache miss: 'lcov.info' added in 'coverage', executing.coverage/also misses:○ cache miss: 'foo.txt' removed from 'coverage', confirming file tracking reaches inside the gitignored directory.coverage/, consecutive runs stay cache hits (vp run: cache hit, 856ms saved.), so the miss is caused solely by the gitignored directory appearing, not by flakiness.vp run utils#check(runsvp checkinpackages/utils) stayed a cache hit whencoverage/was created at the workspace root in this environment, unlike the report's monorepo claim that every package's check misses. The root-levelvp checkmiss — the core of the report — reproduces verbatim.Result
Reproduced on the current checkout (
vpv1.8.0 frommain): creating a gitignored folder in the workspace root invalidates the cachedvp checkrun with○ cache miss: 'coverage' added in workspace root, executing, exactly as reported.Observations for diagnosis (no fix proposed)
checkscript: the fingerprint includes the workspace-root directory listing and even the contents of the gitignoredcoverage/directory, although oxfmt/oxlint ignore it via.gitignore.'coverage' added in workspace rootphrasing for the empty-directory case and'<file>' added in 'coverage'for content changes.vp checkscript did not miss in this environment; the difference vs. the report may depend on how each package's auto-tracking resolves its roots (the report says each package's check also lists the workspace root).vp check(built-in, not throughvp run) shows no cache messages and always executes, so the bug is specific tovp runscript caching/auto input tracking.Diagnosis
Layer
The cache-fingerprinting logic lives in Vite Task (
vt), which is a git dependency of this repo (vt = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "6a23096aa2f04eb59225c6467b15c2965ee6ae33" },Cargo.toml:318); source inspected at~/.cargo/git/checkouts/vite-task-b9d2f8c2bec84a8f/6a23096. The missing piece on the Vite+ side is in thevp checkimplementation,packages/cli/binding/src/check/mod.rs.Root cause chain
Who reads the directory:
vp run checkcaches thecheckscript, which runs the built-invp check—execute_checkinpackages/cli/binding/src/check/mod.rs:26spawns the bundled oxfmt/oxlint (viaresolve_and_capture_output, lines 110/211/298) to scan the project. Scanning the workspace root performs a directory listing (getdents), which fspy (syscall-level tracking attached to the task's process tree) records as a path read withread_dir_entries: true.Read filtering:
observe_fspy(crates/vt/src/session/execute/cache_update.rs:225) filters recorded reads only by (a) user-configured input negative globs and (b) tool-reportedignoreInputpaths (crates/vt/src/session/execute/cache_update.rs:87-93).vp checknever reportsignoreInput— the only reporting site in this repo is the Vitest cache-path plugin (packages/cli/src/define-config.ts:828,vitePlusVitestCachePathsPlugin, used byvp test/vp build). So the workspace-root listing becomes an inferred input.Fingerprinting ignores
.gitignore:PostRunFingerprint::create(crates/vt/src/session/execute/fingerprint.rs:149) fingerprints the listing viaprocess_directory_unix(:631) /process_directory(:594), whereshould_ignore_entry(:535) skips only.,.., and.DS_Store. Insidecreate, listing entries are removed only for: rebuildable outputs (rebuildable.is_rebuildable_entry), tool-reported ignored inputs (ignored_input_names,:501), and input negative globs (leave_out_excluded_entries,:517). No vt crate consults.gitignoreanywhere (verified by grep across the checkout). The gitignoredcoverage— like the also-gitignorednode_modules— is therefore stored inDirListing.entries(fingerprint.rs:98).Verified directly: the reproduction's cache DB (
node_modules/.vite/task-cache/v23/cache.db, tablecache_entries) holds the rootchecktask's fingerprint with a workspace-rootDirListingwhose entries areAGENTS.md, README.md, apps, coverage (Dir), node_modules, package.json, packages, ...—coveragestored as a plain tracked entry.Validation misses: on the next run,
PostRunFingerprint::input_changes(fingerprint.rs:218) re-fingerprints the listing;determine_folder_change_kinds(:446) diffs the entry maps, findscoveragepresent but not stored →Change::File { Added, "coverage" }→CacheStatus::Miss(CacheMiss::Changed)→format_input_change_strincrates/vt/src/session/cache/display.rs:119renders the exact observed message:○ cache miss: 'coverage' added in workspace root, executing. Files inside the ignored dir show up the same way ('lcov.info' added in 'coverage'), because listing the folder and fingerprinting its contents are equally unfiltered.Why it happens: the auto-input-tracking design relies on cooperative reports (
ignoreInput,vt_client::Client::ignore_input, exported asignoreInputon@voidzero-dev/vite-task-client) or user negative globs to exclude irrelevant paths, rather than modeling each tool's semantics. oxfmt/oxlint silently skip gitignored entries, butvp checknever tells the runner about them — precisely what the issue reports.Suggested fix approaches (both suggested by the issue; not applied)
vp checkreport the paths it ignores via cooperative tracking — e.g. inexecute_check(or the fmt/lint spawn layer). When invoked fromvp run, the binding is a nested process under the runner and can reach the IPC channel (vt_client::Client::from_envs+ignore_input; the binding already depends on vt crates,packages/cli/binding/Cargo.toml:35-43). Requires enumerating gitignore-respecting exclusions (gitignore semantics exist in-repo, e.g.vp_migration::is_directory_gitignored), or asking the tools to report ignores.vtrepo: consult.gitignorewhen fingerprinting/validating a directory listing (increateandinput_changes), moving ignored names out ofDirListing.entries(a set likeignored_entrieswhose presence/absence doesn't matter). This is a change in the upstreamvite-taskrepository (a git dependency here — no patch to a vendored clone).Edge cases for a fix
!) and nested.gitignorefiles; non-git projects (no repo — must fall back to current behavior).node_modulesis also gitignored and also sits in the stored listing; excluding it from listings appears sound (actual file reads are tracked individually by fspy) but needs validation.ignorePatterns(oxlint config) beyond.gitignoreare out of scope for the reporter's expectation.vp checkfingerprints the workspace root is project/tool dependent: in this reproutils#checkdid not record a root listing (no miss), while the reporter's packages did —execute_checkpasses-c <root config>to the tools when run from a package (packages/cli/binding/src/check/mod.rs:54-70), which can make them list the root.Regression evidence
None found — this is not a regression but a gap in the cooperative-tracking rollout: the
DirListing.ignored_entriesmachinery was built for tool-reportedignoreInput(used by the Vitest cache-path plugin for Vitest 5's on-disk caches,packages/cli/src/define-config.ts:795-855), andvp checksimply never reports anything.Diagnosis confidence
High — the failing logic is proven by code inspection and by direct inspection of the stored fingerprint in the reproduction's cache DB (workspace-root
DirListingcontainingcoverage), and matches the observed verbatim miss message.Verification
Claim
vp checkscript misses its cache when a gitignored folder (coverage/) appears in the workspace root:○ cache miss: 'coverage' added in workspace root, executing(reproduced verbatim; see above).vp checkignores (via.gitignore) must not affect its cache.Research
Vite+ docs (this repo)
docs/guide/automatic-data-tracking.mddocuments directory listings as tracked file-system inputs: "Vite Task records ... directories the command scanned. Subsequent runs re-run the task when one of those tracked inputs changes."input: [{ auto: true }, '!dist/**']).vp buildandvp test(e.g. the Vitest cache-path plugin,packages/cli/src/define-config.ts:828) and "It will extend this support to more first-party tools in the future." — i.e.vp checknot reporting ignores is a documented, known gap, slated for extension, not an accidental behavior.Upstream Vite Task (the crate that owns the fingerprinting)
distentries from listing fingerprints because hiding an entry can replay stale output ("adistfolder appearing in a folder the task listed goes unseen, and the next run replays stale output:oxlint, for example, passes from the cache after adistfolder with lint errors appears"). Since then listings deliberately skip only.,..,.DS_Store(fingerprint.rs:535 should_ignore_entry), with e2e snapshots asserting the miss wording (crates/vt_bin/tests/e2e_snapshots/fixtures/cache_miss_reasons/snapshots/inferred_input_changes.md:58) and asserting the sanctioned exclusion path (fixtures/negative_glob_hides_listing_entry/).inputglobs (what the reporter uses as a workaround).DirListing.entries; no gitignore awareness in vt). It proposes an opt-in per-task setting (listings: { gitIgnored: false }) where ignored entries leave listings, reads beneath them still invalidate, and the.gitignorefiles themselves become inputs — explicitly opt-in "because of Extension Pack for IntelliJ #919", since a tool that would read an ignored entry must not get a stale replay. So the maintainers treat the current default as deliberate, with a designed refinement outstanding.Prior Vite+ history
vp create monoreporequires 2–3vp run readyinvocations before cache stabilizes #1638 (closed by PR ci: warm-up monorepo cache test under npm #1649) reported a near-identical false miss ('node_modules' added in 'packages/utils'invalidating a cached rootvp check). It was triagedbugfor the onboarding UX (fresh monorepo needing 2–3vp run readyruns), but was fixed only by a CI warm-up; PR ci: warm-up monorepo cache test under npm #1649's description calls the proper fix (ignoringnode_modulesin directory fingerprints) a possible follow-up that has not landed. The strict listing semantics themselves were never changed.Verdict
Intended-behavior (with a maintainer-acknowledged enhancement outstanding).
The observed miss is the deliberate safe-by-construction default chosen in vite-task PR #919: every entry of a listed directory counts, because skipping entries that a tool might read can replay stale output. The sanctioned exclusion mechanism (negative
inputglobs, PR #941) and cooperativeignoreInputreports exist and are documented in this repo;vp checksimply does not report gitignored paths yet, which the docs describe as future work ("will extend this support to more first-party tools"). Upstream issue vite-task#992 — same root cause, maintainer-authored — frames the gitignore-aware variant as an opt-in proposal precisely because the strict default is intentional. Nothing in docs, tests, or commits says a gitignored entry must not invalidate the cache; the current behavior contradicts no documented intent.The reporter's underlying expectation is nonetheless endorsed upstream as the direction of travel: an opt-in gitignore-aware listing mode (vite-task#992) and/or extending cooperative tracking to
vp checkwould remove these false misses without weakening the stale-replay guarantees. That is an enhancement to track against vite-task#992, not a defect in the current design.Verification confidence
High — direct evidence: merged upstream PR #919 (rationale + e2e tests asserting misses on appearing entries), merged PR #941 (sanctioned exclusion mechanism), open maintainer-authored upstream issue #992 (same root cause, opt-in proposal), and Vite+ docs documenting the limitation and the workaround.
This report was made by an LLM. The analysis may be wrong, and the potential fix might not work, but is intended as a starting point for exploring the issue.