fix: resolve relative file paths in CLI before sending to daemon#667
Open
juliobrasa wants to merge 1 commit intovercel-labs:mainfrom
Open
fix: resolve relative file paths in CLI before sending to daemon#667juliobrasa wants to merge 1 commit intovercel-labs:mainfrom
juliobrasa wants to merge 1 commit intovercel-labs:mainfrom
Conversation
When commands like screenshot, pdf, upload, download, trace, record, and state accept file paths, relative paths were resolved against the daemon's working directory instead of the CLI's CWD. This caused files to be saved/read from unexpected locations. Add resolve_path() helper that converts relative paths to absolute paths using the CLI's current working directory before sending them to the daemon process. Fixes vercel-labs#137 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
|
Someone is attempting to deploy a commit to the Vercel Labs Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
There was a problem hiding this comment.
Additional Suggestions:
- The
waitfordownloadandprofiler stopcommands send relative file paths to the daemon without resolving them to absolute paths, unlike all other path-taking commands in the PR.
- Tests for recording_start, recording_restart, trace_stop, and download commands assert against raw relative paths but the code now applies resolve_path() which converts them to absolute paths, causing test failures.
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
resolve_path()helper that converts relative paths to absolute using the CLI's CWDProblem
When using commands like
agent-browser screenshot ./page.png, the relative path./page.pngwas resolved against the daemon's working directory (wherever it was spawned from) instead of the user's current directory. This caused files to appear in unexpected locations.Test plan
cargo checkpassesFixes #137
🤖 Generated with Claude Code