Repository navigation
fix(plan): run synthetic requests in the handler's cwd - #1005
Open
jong-kyung wants to merge 2 commits into
Open
jong-kyung wants to merge 2 commits into
jong-kyung wants to merge 2 commits into
Conversation
A command handler can change `ScriptCommand.cwd`, and verbatim commands and nested `vp run` queries already use the changed cwd. Synthetic requests ignored it and ran in the task's cwd, so a handler could not synthesize a command for another directory, such as `vp -C <dir> lint`. Co-authored-by: Claude Opus 5.5 <[email protected]>
Contributor
Author
|
cc @fengmk2 |
Contributor
Author
|
@codex review |
jong-kyung
marked this pull request as ready for review
November 21, 2026 04:59
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. |
fengmk2
reviewed
Nov 22, 2026
Co-authored-by: Claude Opus 5.5 <[email protected]>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Motivation
In Vite+, a cached task whose command starts with
vp -C <dir>ignores the cache settings of its subcommand, as reported in voidzero-dev/vite-plus#3503. For example,vp -C . lintdoes not trackOXLINT_TSGOLINT_PATH, so changing it replays the cache, and the variable never reaches the command. The Vite+ command handler returnsVerbatimfor a leading-Cbecause it has no way to run a synthesized command in another directory. A handler can already changeScriptCommand.cwd, and verbatim commands and nestedvp runqueries use the changed cwd. Synthetic requests ignored it and always ran in the task's cwd.Change
Synthetic requests now run in
script_command.cwd, so a handler that changes the cwd gets the same result for all three kinds of request. The cwd change applies only to that command, which means later commands in the same&&chain keep the task's cwd. Input globs based on the package still resolve against the task's package, as they do aftercd.The test handler in
vt_bingainsvt tool -C <dir>so that a plan snapshot can cover a handler that changes the cwd.Planned follow-up in Vite+
After this merges, the Vite+ handler will remove a leading
-C <dir>from the command, setcommand.cwdto the target directory, and then handle the rest of the command exactly as it would without-C. This makesvp -C <dir> <command>in a task behave likecd <dir> && vp <command>. Every subcommand then uses its own cache settings, package manager commands are no longer cached, andvp -C <dir> runexpands in the same session. When the directory does not exist or is outside the workspace, the handler keeps the current verbatim behavior so thatvpreports the error the same way as a direct invocation.