Conversation
OrKoN
requested changes
Sep 30, 2026
OrKoN
left a comment
Collaborator
There was a problem hiding this comment.
Thanks for the PR:
- Return
filePathOrUrlunchanged whenfilePathOrUrl.trim().length === 0inresolveFilePath(src/config/cli-commands.ts). Callingpath.resolve(cwd, filePathOrUrl)on empty or whitespace-only strings turns them intocwd(or${cwd}/...) instead of lettingvalidateAndResolvePathOrUrl(src/ToolHandler.ts) clear them toundefined. - Rebase onto
main, re-runnpm run gento updatesrc/config/cli-options.ts, and replacefs.mkdtemp/fs.rmintests/e2e/chrome-devtools-commands.test.tswithusing rootDirectory = createTempDir('cli-file-path-')fromtests/utils.ts(ensuringrunCli(['stop'], sessionId)runs beforerootDirectoryis disposed).mainnow enforces thelocal/enforce-usingESLint rule against directmkdtempcalls in tests and includes changes insrc/config/cli-options.ts,tests/cli.test.ts, andtests/utils.tsthat conflict with this branch.
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
verifyFilesSchemaWhy
The CLI client and the long-running daemon can have different current working directories. Sending a relative file argument unchanged makes the daemon resolve it from the wrong directory, so commands such as
take_screenshot,take_snapshot,upload_file, and other file-accepting commands can read or write the wrong location, or fail.This follow-up was requested during the review of #2606 and keeps the generic CLI behavior independent of the
evaluate_scriptfeature.Testing
npm run gennpm run test -- tests/cli.test.tsnpm run test -- tests/e2e/chrome-devtools-commands.test.tsnpm run test