Skip to content

fix(cli): keep subcommand cache config for vp -C in task scripts - #3537

Merged
fengmk2 merged 12 commits into
voidzero-dev:mainfrom
jong-kyung:fix/leading-c-cache-config
Nov 23, 2026
Merged

fengmk2 merged 12 commits into
voidzero-dev:mainfrom
jong-kyung:fix/leading-c-cache-config

Conversation

@jong-kyung

@jong-kyung jong-kyung commented Nov 22, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #3503.

A task command that starts with vp -C <dir> ran verbatim, so the subcommand lost its cache config. For example, vp -C . check did not track OXLINT_TSGOLINT_PATH or VP_SKIP_STATIC_CONFIG, which means changing either variable replayed the cache.

Change

The command still runs in a child vp, so the directory change, Node runtime, toolchain selection, and JS entrypoint behave exactly like a direct vp -C invocation. When the arguments after -C <dir> form a built-in subcommand, the handler now attaches that subcommand's cache config to the child. Anything else, such as vp -C <dir> run, --version, or a bare vp -C <dir>, runs verbatim as before.

@jong-kyung jong-kyung self-assigned this Nov 22, 2026
@jong-kyung jong-kyung added test: e2e Auto run e2e tests test: install-e2e run vite install e2e test test: create-e2e Run `vp create` e2e tests test: sfw labels Nov 22, 2026
@jong-kyung

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-22T23:23:01.504135Z 92994e3 Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@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: 40417532c0

ℹ️ 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 packages/cli/binding/src/cli/handler.rs Resolved
Comment thread packages/cli/binding/src/cli/handler.rs Resolved
@jong-kyung

Copy link
Copy Markdown
Collaborator Author

@codex review

@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: 2e228161b2

ℹ️ 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 packages/cli/binding/src/cli/handler.rs Resolved
Comment thread packages/cli/binding/src/cli/handler.rs Resolved
@jong-kyung

Copy link
Copy Markdown
Collaborator Author

@codex review

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

ℹ️ 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 packages/cli/binding/src/cli/handler.rs Resolved
Comment thread packages/cli/binding/src/cli/handler.rs Resolved
@jong-kyung

Copy link
Copy Markdown
Collaborator Author

@codex review

@jong-kyung
jong-kyung force-pushed the fix/leading-c-cache-config branch from 55956c9 to 080825f Compare November 22, 2026 14:40

@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: 55956c910c

ℹ️ 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 packages/cli/binding/src/cli/handler.rs Resolved
…d task handler

Each synthesizable subcommand's cache config lived inline in
`SubcommandResolver::resolve`, and the task handler built the check config
separately. `cache_config_for` now returns the config for any subcommand, so
the resolver and the handler use one source and cannot drift apart.
A task command that starts with `vp -C <dir>` ran verbatim, so the subcommand
lost its cache config. For example, `vp -C . check` did not track
`OXLINT_TSGOLINT_PATH` or `VP_SKIP_STATIC_CONFIG`, which means changing either
variable replayed the cache.

The command still runs in a child `vp`, which applies the directory, Node
runtime, and toolchain like a direct invocation. When the rest is a built-in
subcommand, the handler now attaches that subcommand's cache config.

Fixes voidzero-dev#3503
@jong-kyung
jong-kyung force-pushed the fix/leading-c-cache-config branch from 080825f to 9a2310d Compare November 22, 2026 14:44
@jong-kyung

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: 9a2310d92b

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

A `vp -C <dir>` task command keeps the task's package as the plan's package,
so the subcommand's package-relative globs resolved against that package
instead of the target. For `vp -C packages/app pack` in a root task, pack's
`!dist/**` excluded the root `dist` from the cache inputs, so a change to a
root `dist` file that the package bundles replayed a stale build.

The handler now rewrites those globs as workspace-relative globs under the
target directory. A target outside the workspace cannot be expressed this way,
so its package-relative globs are dropped, which matches the verbatim command
that had no exclusions.
@jong-kyung

Copy link
Copy Markdown
Collaborator Author

@codex review

@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: 204eba4bf4

ℹ️ 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 packages/cli/binding/src/cli/handler.rs Resolved
Rebasing a package-relative glob onto the `vp -C` target put the directory
name into the pattern as glob syntax. For `vp -C 'packages/[ab]' pack`, the
exclusion matched the sibling `packages/a` and `packages/b` output
directories, and for `vp -C 'packages/(app)' pack` the pattern failed to parse,
so the task failed to plan.

The target path is now escaped with `wax::escape`, the glob library that Vite
Task uses to read these patterns, so the target matches only itself.
@jong-kyung

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: 765290d5aa

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

@jong-kyung
jong-kyung marked this pull request as ready for review November 22, 2026 23:17
@jong-kyung
jong-kyung requested a review from fengmk2 November 22, 2026 23:25
@fengmk2
fengmk2 merged commit dfeeb26 into voidzero-dev:main Nov 23, 2026
128 of 129 checks passed
@jong-kyung
jong-kyung deleted the fix/leading-c-cache-config branch November 23, 2026 08:58
@fengmk2 fengmk2 mentioned this pull request Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test: create-e2e Run `vp create` e2e tests test: e2e Auto run e2e tests test: install-e2e run vite install e2e test test: sfw

Projects

None yet

Development

Successfully merging this pull request may close these issues.

vp -C <dir> check and vp -C <dir> lint in cached tasks ignore their tracked environment variables

2 participants