Skip to content

fix(plan): plan nested run commands outside the workspace as written after cd - #867

Open
tlq5l wants to merge 2 commits into
voidzero-dev:mainfrom
tlq5l:fix/nested-run-after-cd
Open

tlq5l wants to merge 2 commits into
voidzero-dev:mainfrom
tlq5l:fix/nested-run-after-cd

Conversation

@tlq5l

@tlq5l tlq5l commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

fix(plan): plan nested run commands outside the workspace as written after cd

Motivation

In a script like cd ui && vpr hello, where ui is a separate project that the workspace does not list, vp run planned the nested vpr in process. The package query for the new directory fell back to the enclosing package, so the workspace root's hello ran instead of ui's. The same command in a subshell, or typed in a shell, ran ui's hello.

After a cd, the planner now checks whether the new directory belongs to a different workspace root. If it does, the nested vp run is spawned as written, so it discovers its own workspace as it does in a shell. Directories inside the workspace, including workspace packages and subfolders without a package.json, are planned in process as before.

The check uses find_workspace_root, so with #859 it also covers a nested project under a pnpm-workspace.yaml that doesn't list it (vite-plus#3013).

Fixes voidzero-dev/vite-plus#3129

tlq5l and others added 2 commits October 20, 2026 08:42
…after cd

A script such as `cd ui && vpr hello` planned the nested `vp run` in
process. When `ui` is a separate project that this workspace does not
list, the package query fell back to the enclosing package, so the
workspace root's `hello` ran instead of `ui`'s.

After a `cd`, if the new directory belongs to a different workspace root
(`find_workspace_root`), the nested run now spawns as written, so it
discovers its own workspace as it does in a shell.

Fixes voidzero-dev/vite-plus#3129

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

vp run ignores cd before a nested vpr in a script and runs the parent package's task

1 participant