feat: add --cache/--no-cache CLI flags to vp run#196
Merged
branchseer merged 8 commits intomainfrom Mar 5, 2026
Merged
Conversation
3 tasks
Member
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
…lan stage Move global cache config resolution from task graph load time to plan time, enabling CLI overrides and proper nested vp run support. Key changes: - Add TaskSource enum to distinguish TaskConfig vs PackageJsonScript - Store ResolvedGlobalCacheConfig on IndexedTaskGraph without applying the global kill switch at graph load time - Add CacheOverride enum (None/ForceEnabled/ForceDisabled) to PlanOptions - Add --cache and --no-cache flags to RunFlags with conflicts_with - Compute final ResolvedGlobalCacheConfig in PlanContext by combining graph config with CLI override - Apply effective_cache_config per task at plan time using TaskSource - Nested vp run --cache/--no-cache overrides parent's resolved config https://claude.ai/code/session_01AYbt3E5j8Adk9NB7Sprkah
… scope Add two new plan snapshot test fixtures: - cache-cli-override: Tests CLI flag overriding rules - --cache enables task/script caching when globally disabled - --cache does not override per-task cache: false - --no-cache disables caching even with per-task cache: true - --cache and --no-cache conflict produces an error - nested-cache-override: Tests scope of nested vp run cache flags - nested --no-cache disables inner task caching - nested --cache enables inner task caching - nested run without flags inherits parent resolved cache - outer --no-cache does not propagate into nested --cache - outer --no-cache propagates to nested run without flags https://claude.ai/code/session_01AYbt3E5j8Adk9NB7Sprkah
The task graph now stores per-task cache config without applying the global kill switch. Add plan test cases to verify cache is correctly resolved to null at plan time when the global config disables caching. Updated fixtures (commands changed from echo to print-file to produce Spawn nodes with visible cache_metadata in plan snapshots): - cache-tasks-disabled: verify tasks/scripts not cached with cache.tasks: false - cache-scripts-default: verify scripts not cached by default - cache-scripts-task-override: verify tasks cached, scripts not cached by default - cache-true-no-force-enable: verify per-task cache: false respected with cache: true https://claude.ai/code/session_01AYbt3E5j8Adk9NB7Sprkah
Change nested-cache-override fixture from `"cache": true` to default config (scripts: false, tasks: true). This makes the tests more meaningful since scripts aren't cached by default. Add "outer --cache propagates to nested run without flags" test case to verify that `vp run --cache outer` where outer runs `vp run inner` correctly caches the inner script despite scripts being off globally. https://claude.ai/code/session_01AYbt3E5j8Adk9NB7Sprkah
Update CacheOverride::None doc to explain inheritance from parent context. Add comments on the if-guard in plan_query_request explaining why skipping the update enables propagation, and why overrides are relative to the workspace config rather than the parent's resolved state. https://claude.ai/code/session_01AYbt3E5j8Adk9NB7Sprkah
--cache acts as cache: true, overriding both cache.tasks and cache.scripts (not just scripts). Restructure the decision tree to reflect that --cache/--no-cache are resolved first as global overrides, then per-task cache: false is checked, then the task-vs-script distinction determines which global switch applies. https://claude.ai/code/session_01AYbt3E5j8Adk9NB7Sprkah
Per-task cache: false only applies to tasks (scripts can't have it), so it belongs under the task branch, not before the task/script split. https://claude.ai/code/session_01AYbt3E5j8Adk9NB7Sprkah
This file belongs on the docs branch, not here. https://claude.ai/code/session_01AYbt3E5j8Adk9NB7Sprkah
31fd15f to
2537b34
Compare
fengmk2
approved these changes
Mar 5, 2026
7 tasks
Member
Author
Merge activity
|
branchseer
added a commit
that referenced
this pull request
Mar 5, 2026
## Summary - Add skip rule and prune rule to prevent infinite recursion when workspace root tasks reference themselves (e.g., `"build": "vp run -r build"`) - Reject unknown fields in `vite-task.json` with `deny_unknown_fields` - Test coverage for extra_arg interaction and `cd` changing the cwd ## Stack - #196 ## Test plan - [x] Plan snapshot tests for self-reference, multi-command, mutual recursion, depends-on passthrough, cd-no-skip fixtures - [x] Unit tests for unknown field rejection at top-level and task-level - [x] All plan snapshot tests pass 🤖 Generated with [Claude Code](https://claude.com/claude-code)
This was referenced Mar 8, 2026
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.

Summary
Adds
--cacheand--no-cacheCLI flags tovp runthat override the global cache configuration:--cacheforces caching on for all tasks and scripts (per-taskcache: falseis still respected)--no-cacheforces all caching offvp runcommands within task scripts — a nestedvp run --no-cache innerwill disable caching for the inner execution regardless of the parent's configExamples
Architectural change
Global cache resolution has been moved from task graph load time to the plan stage. The task graph now stores per-task cache config without applying the global kill switch, and the final cache decision is made at plan time where CLI overrides are available. This enables proper support for nested
vp run --cache/--no-cache.Test plan
cargo test -p vite_task_graph --libunit tests passcargo clippyclean on all modified crates