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
feat(cache): runner-aware env tracking via getEnv/getEnvs
Makes the addon's getEnv/getEnvs no-ops real — protocol verbs, sync
client round-trips, and server-side serving — and fingerprints the
served values so changing them invalidates the cache:
- getEnv/getEnvs are served from the spawn's full env context saved in
the plan: the same env map the task is spawned with, including
command-prefix and nested-run prefix envs. std::env::vars_os is read
exactly once to bootstrap the session env snapshot (enforced by
clippy).
- Served values and glob match-sets are recorded in the post-run
fingerprint and validated on the next lookup; prerun and postrun env
mismatches share one EnvMismatch enum, and misses name the env var
inline (cache miss: env 'NODE_ENV' changed).
- E2E: direct-client fixtures cover value changes, glob match-set
changes, and prefix-env visibility; real vite build re-runs on
NODE_ENV/prefix-env changes via the served values.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,6 @@
1
1
# Changelog
2
2
3
+
-**Added** Runner-aware env tracking: tools can ask the runner for env values via `getEnv`/`getEnvs`, and the served values (and glob match-sets) become part of the cache fingerprint, so changing them invalidates the cache with the env var named in the miss message ([#430](https://github.com/voidzero-dev/vite-task/pull/430))
3
4
-**Added** Runner-aware tools can now opt the current task run out of caching through the new IPC channel; Vite dev server integration uses this automatically ([#441](https://github.com/voidzero-dev/vite-task/pull/441))
4
5
-**Fixed** Prefix environment assignments like `PATH=... command` now affect executable lookup during task planning, so tools provided only by the prefixed `PATH` can be resolved correctly ([#440](https://github.com/voidzero-dev/vite-task/pull/440))
5
6
-**Changed** Cache misses caused by a tracked env var now name the env var inline, for example `cache miss: env 'NODE_ENV' changed`, instead of the generic `envs changed` message ([#438](https://github.com/voidzero-dev/vite-task/pull/438))
Copy file name to clipboardExpand all lines: CLAUDE.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -140,6 +140,10 @@ Enforced by `.clippy.toml`:
140
140
- Only convert to std paths when interfacing with std library functions
141
141
- Add necessary methods in `vite_path` instead of falling back to std path types
142
142
143
+
### Environment Variables
144
+
145
+
`std::env::vars_os` is read exactly once — in `Session::init` — to bootstrap the session env snapshot (`Session.envs`). Everything downstream (planning, spawn env resolution, IPC `getEnv`/`getEnvs`, cache fingerprint validation) must use that snapshot or the plan's resolved env maps, never re-read the live process env. This keeps a run's behavior consistent with its plan and lets tests inject envs via `Session::init_with`.
146
+
143
147
### Cross-Platform Requirements
144
148
145
149
All code must work on both Unix and Windows without platform skipping:
0 commit comments