fix(tools): add AllowPaths support to list_files tool#140
Open
quansang wants to merge 1 commit intonextlevelbuilder:mainfrom
Open
fix(tools): add AllowPaths support to list_files tool#140quansang wants to merge 1 commit intonextlevelbuilder:mainfrom
quansang wants to merge 1 commit intonextlevelbuilder:mainfrom
Conversation
The list_files tool was missing the PathAllowable interface implementation that read_file already had. This caused "access denied: path outside workspace" errors when agents tried to list files in skill directories. Changes: - Add allowedPrefixes field to ListFilesTool struct - Add AllowPaths() method to implement PathAllowable interface - Use resolvePathWithAllowed() instead of resolvePath() in Execute() - Add wiring in gateway.go to allow list_files access to skills directories Fixes: list_files can now access paths outside workspace that are whitelisted via AllowPaths(), matching read_file behavior.
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
Fixes #143
The
list_filestool was missing thePathAllowableinterface implementation thatread_filealready had. This causedaccess denied: path outside workspaceerrors when agents tried to list files in skill directories.Problem
read_filecan access skill directories viaAllowPaths()whitelistlist_fileslacks this capability and fails with permission errorsSolution
allowedPrefixesfield toListFilesToolstructAllowPaths()method to implementPathAllowableinterfaceresolvePathWithAllowed()instead ofresolvePath()inExecute()gateway.goto allowlist_filesaccess to skills directoriesChanges
internal/tools/filesystem_list.go: +9 linescmd/gateway.go: +14 linesVerification
Checklist
go vet)read_fileimplementation)