fix(filesystem): improve roots diagnostics and add tilde path coverage#3414
Open
ahmetguness wants to merge 1 commit intomodelcontextprotocol:mainfrom
Open
fix(filesystem): improve roots diagnostics and add tilde path coverage#3414ahmetguness wants to merge 1 commit intomodelcontextprotocol:mainfrom
ahmetguness wants to merge 1 commit intomodelcontextprotocol:mainfrom
Conversation
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
Improves root URI diagnostics and adds explicit test coverage for tilde-prefixed path edge cases in the filesystem server.
This change does not modify the intended tilde expansion semantics. Instead, it:
expandHomeRelated to #3412
Details
1. Diagnostics Improvements
parseRootUripreviously swallowed resolution errors silently.This change adds descriptive logging when a root URI cannot be resolved, helping diagnose client-side configuration issues (e.g. invalid paths, inaccessible directories).
If no valid roots remain after validation, the error output now includes the received root URIs for easier debugging.
2. Tilde Handling Clarification
The existing
expandHomebehavior remains unchanged:~and~/...expand to the user's home directory~MyFolderor/path/~backupremain unchangedThe change removes duplicated tilde handling logic and centralizes it through
expandHome.3. Test Coverage
Adds explicit tests for:
~MyFolder(literal name, not expanded)~user(not expanded)file://root URIs containing tilde-prefixed directoriesAll tests pass locally on Windows (
151/151).Type of Change
Breaking Changes
None.