Skip to content

refactor: make validatePath return resolved url - #2572

Merged
OrKoN merged 3 commits into
mainfrom
orkon/symlinks
Aug 17, 2026
Merged

OrKoN merged 3 commits into
mainfrom
orkon/symlinks

Conversation

@OrKoN

@OrKoN OrKoN commented Aug 13, 2026 •

Copy link
Copy Markdown
Collaborator

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

@OrKoN
OrKoN requested a review from nroscino August 13, 2026 13:50

@Lightning00Blade Lightning00Blade left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM,
Should we swap the value in the parameters with the resolved one?
src/ToolHandler.ts:191?

@OrKoN

OrKoN commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator Author

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.

Comment thread tests/tools/memory.test.ts Resolved

@nroscino nroscino left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

@OrKoN

OrKoN commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator Author

LGTM, Should we swap the value in the parameters with the resolved one? src/ToolHandler.ts:191?

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.

@OrKoN

OrKoN commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator Author

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?

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.

@nroscino nroscino left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Comment thread src/ToolHandler.ts Resolved
Comment thread src/ToolHandler.ts Resolved
Comment thread src/ToolHandler.ts Resolved
@OrKoN
OrKoN added this pull request to the merge queue Aug 17, 2026
Merged via the queue into main with commit 57adfa9 Aug 17, 2026
23 checks passed
@OrKoN
OrKoN deleted the orkon/symlinks branch August 17, 2026 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants