fix: centralize file path validation for tools#2150
Closed
msnandhis wants to merge 1 commit into
Closed
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
OrKoN
reviewed
May 28, 2026
| category: ToolCategory.DEBUGGING, | ||
| // Not read-only due to filePath param. | ||
| readOnlyHint: false, | ||
| filePathFields: [], |
Collaborator
There was a problem hiding this comment.
Thanks for the PR, we discussed it offline and we actually want to move filePathFields to the same level as blockedByDialog (i.e., outside of annotations). cc @Lightning00Blade
pull Bot
pushed a commit
to CrazyForks/chrome-devtools-mcp
that referenced
this pull request
May 28, 2026
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.
Fixes #2138.
Summary
This centralizes workspace-root validation for request file path fields instead of having individual tool handlers call
context.validatePath(...)directly.Changes included:
annotations.filePathFieldsmetadata to tool definitionsToolHandlerbefore handler executionfilePath,requestFilePath,responseFilePath,outputDirPath, and extensionpathreload_extension, because that path is resolved from existing extension state rather than from request paramsToolHandlercoverage to ensure annotated file path fields are validated before the handler runsTesting
npm run formatnpm run check-formatnpm run test tests/ToolHandler.test.tsI also started a full
npm run test; it built and ran many tests locally, then remained quiet in a daemon/browser section, so I stopped the local run and cleaned up the spawned daemon processes rather than leaving them running.