chore(tools): Suppress noisy/sensitive paths from fs tool results - #884
Merged
Conversation
The `fs_list_files`, `fs_grep_files`, and `fs_read_file` tools gain an `options.suppress` list of `.ignore`-style patterns for paths they may read but must never hand back to the model. `.git/` and `**/target/` are suppressed by default across all of them, so a search or listing no longer floods the model with build output or exposes repository internals it has no business seeing. Read access to those paths is unaffected: `access.fs` still governs what the tool process may touch, which is why `fs_modify_file` can keep running `git status` against a suppressed `.git` to check for uncommitted work. A path skipped for suppression, or because the access policy denies read, is no longer silently dropped from listings and searches. The result now names what was skipped and why, and points at asking the user for the content instead of letting an empty result read as evidence the content does not exist. Explicitly naming a path (e.g. `fs_read_file` on an exact file) still reaches it even when a `.ignore` rule would otherwise prune it from an unscoped listing; only `suppress` and the access policy can withhold an explicitly named path. `fs_list_files` and `fs_grep_files` also correctly handle a prefix naming a file directly, and a prefix naming a directory whose pruning rule lives below the workspace root (e.g. a nested `.ignore`), by walking that subtree as its own root instead of silently returning nothing. Access-denial error messages from the fs tools now list only the paths that grant the specific denied capability, rather than every configured grant path, and point the model at asking the user for access rather than leaving the refusal as a dead end. Signed-off-by: Jean Mertz <git@jeanmertz.com>
Signed-off-by: Jean Mertz <git@jeanmertz.com>
Signed-off-by: Jean Mertz <git@jeanmertz.com>
Signed-off-by: Jean Mertz <git@jeanmertz.com>
Signed-off-by: Jean Mertz <git@jeanmertz.com>
Signed-off-by: Jean Mertz <git@jeanmertz.com>
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.
The
fs_list_files,fs_grep_files, andfs_read_filetools gain anoptions.suppresslist of.ignore-style patterns for paths they may read but must never hand back to the model..git/and**/target/are suppressed by default across all of them, so a search or listing no longer floods the model with build output or exposes repository internals it has no business seeing. Read access to those paths is unaffected:access.fsstill governs what the tool process may touch, which is whyfs_modify_filecan keep runninggit statusagainst a suppressed.gitto check for uncommitted work.A path skipped for suppression, or because the access policy denies read, is no longer silently dropped from listings and searches. The result now names what was skipped and why, and points at asking the user for the content instead of letting an empty result read as evidence the content does not exist. Explicitly naming a path (e.g.
fs_read_fileon an exact file) still reaches it even when a.ignorerule would otherwise prune it from an unscoped listing; onlysuppressand the access policy can withhold an explicitly named path.fs_list_filesandfs_grep_filesalso correctly handle a prefix naming a file directly, and a prefix naming a directory whose pruning rule lives below the workspace root (e.g. a nested.ignore), by walking that subtree as its own root instead of silently returning nothing.Access-denial error messages from the fs tools now list only the paths that grant the specific denied capability, rather than every configured grant path, and point the model at asking the user for access rather than leaving the refusal as a dead end.