Repository navigation
refactor: make validatePath return resolved url - #2572
Conversation
Lightning00Blade
left a comment
There was a problem hiding this comment.
LGTM,
Should we swap the value in the parameters with the resolved one?
src/ToolHandler.ts:191?
I think no because we might want to use the user provided value for responses to not break expectations if the canonical path is different from the input path. The resolved path is also always absolute. |
nroscino
left a comment
There was a problem hiding this comment.
LGTM % question.
Maybe it could be worth, like we do for saveFile, to use the path returned from the validatePath for the for installExtension and installPWA tools, WDYT?
I thought about this more and I think we should do that after all since we already return resolved paths in a bunch of tools. |
Updated the PR with replacing paths with resolved ones in ToolHandler so this should cover those two as well. Re-configured extensions to only validate paths for local Chrome's. |
This changes the internal responsibility: validatePath is the only place that is expected to follow symlinks if it can. It then returns a resolved path for all consumers in the MCP server who are expected not to follow symlinks.
This is to be combined with the followSymlinks=false setting in puppeteer/puppeteer#15335