GeezerVison is showing github.com — feat(client): serve getEnv over runner IPC by wan9chi · Pull Request #446 · voidzero-dev/vite-task
Conversation
wan9chi
commented
Jun 13, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Motivation
The JS client exposes getEnv, but before this slice it still fell back to no-op behavior. Runner-aware tools need a real request/response path for single env reads before those reads can be used for cache tracking.
Scope
Add the GetEnv protocol frame, Rust client response handling, server-side resolution from the spawned task env map, and a real NAPI getEnv implementation. This PR intentionally does not add tracked env reads to cache fingerprints.
Verification
cargo test -p vite_task_server --test integration
UPDATE_SNAPSHOTS=1 cargo test -p vite_task_bin --test e2e_snapshots fetch_env_reads_declared_env -- --ignored
cargo test -p vite_task_bin --test e2e_snapshots fetch_env_reads_declared_env -- --ignored
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Jun 13, 2026
wan9chi
commented
Jun 13, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Jun 13, 2026
Motivation:
The JS client already exposes getEnv, but before this change it always fell back to no-op behavior. Runner-aware tools need a real round-trip way to ask the runner for an env value before those reads can be used for cache tracking.
Scope:
Add the GetEnv request/response frame, response reading in the Rust client, server-side resolution from the spawned task env map, and a real NAPI getEnv implementation. This PR intentionally does not add tracked envs to cache fingerprints.
Verification:
- cargo test -p vite_task_server --test integration
- UPDATE_SNAPSHOTS=1 cargo test -p vite_task_bin --test e2e_snapshots fetch_env_reads_declared_env -- --ignored
- cargo test -p vite_task_bin --test e2e_snapshots fetch_env_reads_declared_env -- --ignored
There was a problem hiding this comment.
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: 01191f8ed1
ℹ️ 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".
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
// TODO(env-track): A later PR in this stack replaces this child env
|
|
|
// map with the full planned env context so IPC can serve envs even
|
|
|
// when they were not declared in `env` or `untrackedEnv`.
|
|
|
&spawn_execution.spawn_command.all_envs,
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid serving untracked envs without cache-key tracking
When a cached task declares an output-affecting variable under untrackedEnv, SpawnCommand::all_envs still contains that value, so this handoff lets getEnv("FOO") return it even though this commit does not record env reads in Reports or add them to the cache fingerprint. A task can then cache output that depends on FOO and incorrectly hit after FOO changes; until tracked reads are implemented, serve only fingerprinted envs or force tracked getEnv reads to affect/disable caching.
Useful? React with 👍 / 👎.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
}
|
|
|
|
|
|
fn get_env(&mut self, name: &OsStr) -> Option<Arc<OsStr>> {
|
|
|
self.envs.get(name).cloned()
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Match env names case-insensitively on Windows
On Windows, env names are case-insensitive, and the planner already matches env config case-insensitively while preserving the parent variable's original casing. If the spawned env contains Path but a tool calls getEnv("PATH") (or declares env: ["PATH"]), this exact FxHashMap lookup returns None even though the child process has that variable; use a case-insensitive lookup under cfg(windows) to match spawned-process semantics.
Useful? React with 👍 / 👎.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
wan9chi
commented
Jun 13, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Merge activity
- Jun 13, 4:08 PM UTC: A user started a stack merge that includes this pull request via Graphite.
- Jun 13, 4:08 PM UTC: @wan9chi merged this pull request with Graphite.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|