feat: handle self-recursion in task planning#197
Merged
branchseer merged 9 commits intomainfrom Mar 5, 2026
Merged
Conversation
Member
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
4 tasks
6dd3ac7 to
b465100
Compare
31fd15f to
2537b34
Compare
fengmk2
approved these changes
Mar 5, 2026
7 tasks
Member
Author
Merge activity
|
--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
When a workspace root task's command contains a `vp run` invocation that expands back to include itself, the planner now handles this gracefully instead of treating it as a fatal recursion error. Two rules are implemented: - Rule 1 (Skip): When a nested `vp run` query matches the parent query exactly, the subcommand is skipped (e.g., root's "build": "vp run -r build" when invoked via `vp run -r build`). - Rule 2 (Prune): When the expanding task appears in a different query's expansion result, it is pruned from the graph and edges are reconnected through it (e.g., root's "build": "vp run -r build" when invoked via `vp run build` from root directory). Mutual recursion (A→B→A) remains a fatal error via check_recursion. To enable TaskQuery comparison for Rule 1, a GlobPattern wrapper type is introduced that implements PartialEq by comparing source strings, and PartialEq is derived through the entire type chain from PackageFilter up to TaskQuery. https://claude.ai/code/session_01QdDRLrGeycdzQ4g1FWX4pZ
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… rules - Extra args don't affect skip/prune (they're in PlanOptions, not TaskQuery) - `cd` before `vp run` changes the cwd, producing a different ContainingPackage query, so the skip rule correctly does not fire Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add `deny_unknown_fields` to `UserRunConfig` so typos and removed fields (like `cacheScripts`) produce a clear error at load time. Task-level unknown fields were already rejected via the flatten chain to `UserCacheConfig`. Also fix 5 test fixtures still using the old `cacheScripts` field. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ebb616f to
5f663f0
Compare
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
"build": "vp run -r build")vite-task.jsonwithdeny_unknown_fieldscdchanging the cwdStack
Test plan
🤖 Generated with Claude Code