Skip to content

fix(plan): serve runner getEnv from unfiltered env context#447

Merged
wan9chi merged 1 commit into
mainfrom
infra-get-env-prefix-context
Jun 14, 2026
Merged

fix(plan): serve runner getEnv from unfiltered env context#447
wan9chi merged 1 commit into
mainfrom
infra-get-env-prefix-context

Conversation

@wan9chi

@wan9chi wan9chi commented Jun 13, 2026

Copy link
Copy Markdown
Member

Motivation

Runner-served getEnv values need to match the command context that planning and execution use, including command-prefix envs and enclosing nested vp run prefix envs. Serving only the cache-filtered child env hides undeclared prefix values from runner-aware tools.

Scope

Build on the spawn_envs naming cleanup by storing the unfiltered command env context on CacheMetadata for cached executions, then serve runner getEnv from that context. SpawnCommand::spawn_envs remains focused on the actual child process environment.

This PR intentionally does not add cache fingerprinting for runner-served env reads. That is handled by the next PR in the stack. The e2e fixture now uses one generic fetch_env.mjs <NAME> [...] helper and compares runner-served values with process.env for undeclared envs, command-prefix envs, and nested prefix envs.

Verification

  • cargo test -p vite_task_bin --test e2e_snapshots fetch_env -- --ignored

@wan9chi wan9chi force-pushed the infra-get-env-ipc branch from 87459b6 to fc06b30 Compare June 13, 2026 11:11
@wan9chi wan9chi force-pushed the infra-get-env-prefix-context branch from 7f74f46 to 29db327 Compare June 13, 2026 11:11
@wan9chi wan9chi force-pushed the infra-get-env-ipc branch from fc06b30 to 1174ec4 Compare June 13, 2026 14:22
@wan9chi wan9chi force-pushed the infra-get-env-prefix-context branch from 29db327 to e9111bd Compare June 13, 2026 14:22
@wan9chi wan9chi force-pushed the infra-get-env-ipc branch from 1174ec4 to e301d62 Compare June 13, 2026 14:27
@wan9chi wan9chi force-pushed the infra-get-env-prefix-context branch from e9111bd to 97761ba Compare June 13, 2026 14:27
@wan9chi wan9chi force-pushed the infra-get-env-ipc branch 2 times, most recently from 9d3eeb1 to 1d8eec4 Compare June 13, 2026 14:36
@wan9chi wan9chi force-pushed the infra-get-env-prefix-context branch 2 times, most recently from 4b74a2c to c45b304 Compare June 13, 2026 15:58
@wan9chi wan9chi force-pushed the infra-get-env-ipc branch from 1d8eec4 to 01191f8 Compare June 13, 2026 15:58
@wan9chi wan9chi marked this pull request as ready for review June 13, 2026 15:59

@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: c45b304dc4

ℹ️ 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_plan/src/plan.rs Outdated
@wan9chi wan9chi force-pushed the infra-get-env-ipc branch from 01191f8 to a20f693 Compare June 13, 2026 16:01
@wan9chi wan9chi force-pushed the infra-get-env-prefix-context branch 2 times, most recently from b96d1bd to b3d0921 Compare June 13, 2026 16:03
@wan9chi wan9chi force-pushed the infra-get-env-ipc branch from a20f693 to ad9922d Compare June 13, 2026 16:03
@wan9chi wan9chi changed the base branch from infra-get-env-ipc to graphite-base/447 June 13, 2026 16:08
@wan9chi wan9chi force-pushed the graphite-base/447 branch from ad9922d to e3747d1 Compare June 13, 2026 16:08
@wan9chi wan9chi force-pushed the infra-get-env-prefix-context branch from b3d0921 to 83684b7 Compare June 13, 2026 16:08
@graphite-app graphite-app Bot changed the base branch from graphite-base/447 to main June 13, 2026 16:09
@wan9chi wan9chi force-pushed the infra-get-env-prefix-context branch from 83684b7 to 3dcd916 Compare June 13, 2026 16:09
@wan9chi wan9chi changed the base branch from main to graphite-base/447 June 13, 2026 17:16
@wan9chi wan9chi force-pushed the infra-get-env-prefix-context branch from 3dcd916 to eac9b11 Compare June 13, 2026 17:16
@wan9chi wan9chi changed the base branch from graphite-base/447 to infra-spawn-envs-rename June 13, 2026 17:16
@wan9chi wan9chi changed the base branch from infra-spawn-envs-rename to graphite-base/447 June 13, 2026 17:17
@wan9chi wan9chi force-pushed the graphite-base/447 branch from e001531 to 42cd212 Compare June 13, 2026 17:22
@wan9chi wan9chi force-pushed the infra-get-env-prefix-context branch from eac9b11 to 0a8737d Compare June 13, 2026 17:22
@graphite-app graphite-app Bot changed the base branch from graphite-base/447 to main June 13, 2026 17:22
@wan9chi wan9chi force-pushed the infra-get-env-prefix-context branch 3 times, most recently from 7bf34a6 to feb640c Compare June 13, 2026 17:43
Motivation:

Runner-served getEnv values need to match the command context that planning and execution use, including command-prefix envs and enclosing nested vp run prefix envs. Serving only the filtered child env can hide undeclared prefix values from tools.

Scope:

Build on the spawn_envs naming cleanup by storing the unfiltered command env context on CacheMetadata for cached executions, then serve runner getEnv from that context. This keeps SpawnCommand focused on process-spawn data and intentionally does not add cache fingerprinting for getEnv reads.

Verification:

- UPDATE_SNAPSHOTS=1 cargo test -p vite_task_bin --test e2e_snapshots fetch_env_sees_command_prefix_env -- --ignored

- UPDATE_SNAPSHOTS=1 cargo test -p vite_task_bin --test e2e_snapshots fetch_env_sees_intermediate_prefix_envs -- --ignored

- cargo test -p vite_task_bin --test e2e_snapshots fetch_env_sees_command_prefix_env -- --ignored

- cargo test -p vite_task_bin --test e2e_snapshots fetch_env_sees_intermediate_prefix_envs -- --ignored

- cargo check -p vite_task_plan -p vite_task -p vite_task_bin

- cargo test -p vite_task_plan envs::tests

- cargo test -p vite_task_plan --test plan_snapshots
@wan9chi wan9chi force-pushed the infra-get-env-prefix-context branch from feb640c to 9a6d7ef Compare June 14, 2026 02:21
@wan9chi wan9chi changed the title fix(plan): resolve runner getEnv from spawn env context fix(plan): serve runner getEnv from unfiltered env context Jun 14, 2026

wan9chi commented Jun 14, 2026

Copy link
Copy Markdown
Member Author

Merge activity

  • Jun 14, 2:25 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Jun 14, 2:25 AM UTC: @wan9chi merged this pull request with Graphite.

@wan9chi wan9chi merged commit 700c46a into main Jun 14, 2026
20 checks passed
@wan9chi wan9chi deleted the infra-get-env-prefix-context branch June 14, 2026 02:25
wan9chi added a commit that referenced this pull request Jun 14, 2026
Motivation:
Revert the accidental merge of #448 so the tracked getEnv fingerprinting change can return as a normal reviewed PR instead of being landed out of order.

Scope:
This is a mechanical revert of the #448 squash commit (`2055bb0c`). It removes the tracked getEnv fingerprinting implementation and e2e coverage that #448 introduced, returning `main` to the #447 state.

Verification:
- CI
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