Repository navigation
fix(plan): evaluate cache.env and cache.untrackedEnv patterns independently - #1010
albertusdev wants to merge 2 commits into
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
…dently Before voidzero-dev#425, `EnvFingerprints::resolve` ignored `!`-prefixed patterns, so chaining `untracked_env` and `fingerprinted_envs` into one pattern set was equivalent to a union. Once voidzero-dev#425 enabled `!` negation in `EnvGlobSet`, a negation in either list began excluding names matched by the other — for example, `env: ["VITE_*", "!VITE_DEBUG"]` with `untrackedEnv: ["VITE_DEBUG"]` dropped VITE_DEBUG, and `untrackedEnv: ["CI_*", "!CI_SECRET"]` with `env: ["CI_SECRET"]` dropped CI_SECRET before fingerprinting. Compile each list separately, pass through inherited names matched by either set, and fingerprint inherited values matched by `env`. A negation in one list can no longer exclude a name matched by the other. In particular, keeping a default pass-through name such as NPM_TOKEN out of the spawned process environment now requires excluding it in `untrackedEnv`, and in `env` too if that list matches the name. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
83039a7 to
ffd0e51
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 83039a7209
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // Keep envs matching either list | ||
| envs.retain(|name, _| { | ||
| name.inner().to_str().is_some_and(|name_str| { | ||
| untracked_patterns.is_match(name_str) || fingerprinted_patterns.is_match(name_str) |
There was a problem hiding this comment.
Bump the cache version for the changed environment semantics
When upgrading an existing cache for a task configured with env: ['VITE_*', '!VITE_DEBUG'] and untrackedEnv: ['VITE_DEBUG'], with inherited VITE_DEBUG set, the old implementation omitted that variable whereas this implementation passes it through. However, both fingerprinted_envs and untracked_env_config remain identical, so the cache key does not change. Because CACHE_SCHEMA_VERSION is still 23 in crates/vt/src/session/cache/mod.rs:471, local and remote lookups can replay output produced without VITE_DEBUG instead of rerunning the task with its newly allowed environment. Bump the cache schema version or otherwise distinguish the new matching semantics in the fingerprint.
Useful? React with 👍 / 👎.
acb58f9 to
99cd742
Compare
Bump CACHE_SCHEMA_VERSION from 23 to 24 so existing local and remote cache entries recorded under the previous cross-list env matching behavior are not replayed now that cache.env and cache.untrackedEnv are evaluated independently. Co-authored-by: Gemini 4 Neon <noreply@google.com>
99cd742 to
615eedc
Compare
Motivation
Before #425,
EnvFingerprints::resolveignored!-prefixed patterns, so chainingcache.untrackedEnvandcache.envinto one pattern set was equivalent to a union. Once #425 enabled!negation inEnvGlobSet, a negation in either list began excluding names matched by the other.That makes two normal patterns impossible:
Changes
Match
cache.envandcache.untrackedEnvas separateEnvGlobSets instead of chaining them. For cached tasks, an inherited variable passes through if either list matches it, and the planner fingerprints its inherited value whencache.envmatches it.Bumps
CACHE_SCHEMA_VERSIONto 24 so existing local and remote cache entries recorded under the previous cross-list matching behavior aren't replayed.This changes behavior for configs that relied on a negation crossing lists. For example,
env: ['!NPM_TOKEN']no longer keepsNPM_TOKEN(matched by*_TOKENinDEFAULT_UNTRACKED_ENV) out of the spawned process environment — doing so now requires excluding it incache.untrackedEnv, and incache.envif that list also matches it.AI-assisted (Claude Opus 5.5, Gemini 4 Neon).