feat(plan): let synthesized commands declare a tool entry script - #789
Open
lifeiscontent wants to merge 1 commit into
Open
lifeiscontent wants to merge 1 commit into
lifeiscontent wants to merge 1 commit into
Conversation
Built-in tools are planned with the absolute path of their entry script in args, and args go into the cache key as is. Moving the workspace, or using a second checkout, changes that path and misses the cache. SyntheticPlanRequest gets an optional tool_entry. When the entry is inside the workspace, the planner passes it relative to the task's cwd, so the command and the cache key stay the same after a move. Other paths and all other args are left alone.
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
When a task runs a built-in tool such as
vp lintorvp test, the command is planned with the absolute path of the tool's entry script inargs, andargsare part of the cache key. If the workspace moves, or you run from a second checkout or a git worktree, that path changes and every one of those tasks misses the cache. Closes #790.Changes
SyntheticPlanRequestgets an optionaltool_entry. It's inserted beforeargs, and when it's inside the workspace it's passed relative to the task's cwd. The command that runs and the cache key both use that relative form..., stay absolute. Otherargsare never rewritten.