Skip to content

feat(cache): fingerprint tracked getEnv reads#454

Open
wan9chi wants to merge 1 commit into
mainfrom
codex/reapply-448
Open

feat(cache): fingerprint tracked getEnv reads#454
wan9chi wants to merge 1 commit into
mainfrom
codex/reapply-448

Conversation

@wan9chi

@wan9chi wan9chi commented Jun 14, 2026

Copy link
Copy Markdown
Member

Motivation

Runner-served getEnv values can influence tool output even when the env is not declared in the task config. If cached tasks do not remember those reads, a later run can replay stale output after the served env value changes.

Scope

Always record runner-aware getEnv reads in IPC reports, store SHA-256 hashes of their served values in the post-run fingerprint, validate those hashes during cache lookup, and render env-specific cache miss messages without exposing values. This follows the env hashing model from #455, bumps the cache schema for the new serialized fingerprint field, and raises a post-run fingerprint error instead of treating non-UTF-8 tracked env values as unset.

This PR intentionally does not add the tracked option or getEnvs; those are split into later PRs in the stack.

Verification

  • cargo check -p vite_task
  • cargo test -p vite_task_server --test integration
  • cargo test -p vite_task_bin --test e2e_snapshots fetch_env_tracked_invalidates_on_change -- --ignored
  • cargo test -p vite_task_bin --test e2e_snapshots fetch_env_tracks_with_explicit_inputs -- --ignored

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 64acca084f

ℹ️ 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".

Comment thread crates/vite_task/src/session/execute/cache_update.rs Outdated
@wan9chi wan9chi force-pushed the codex/reapply-448 branch 3 times, most recently from 7c34c50 to 0cae90a Compare June 14, 2026 08:34
Motivation:
Once tools can read env values from the runner, cached tasks must remember tracked getEnv reads. Otherwise a later run can replay stale output after a tracked env value changes.

Scope:
Make the getEnv tracked option meaningful, record served single-env values in IPC reports, store tracked values in the post-run fingerprint, validate them during cache lookup, and render env-specific cache miss messages. This PR intentionally does not implement getEnvs or env glob match-set tracking.

Verification:
- cargo test -p vite_task_server --test integration
- UPDATE_SNAPSHOTS=1 cargo test -p vite_task_bin --test e2e_snapshots fetch_env_tracked_invalidates_on_change -- --ignored
- UPDATE_SNAPSHOTS=1 cargo test -p vite_task_bin --test e2e_snapshots fetch_env_tracks_with_explicit_inputs -- --ignored
- cargo test -p vite_task_bin --test e2e_snapshots fetch_env_tracked_invalidates_on_change -- --ignored
- cargo test -p vite_task_bin --test e2e_snapshots fetch_env_tracks_with_explicit_inputs -- --ignored
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant