enhance: improve filesystem & shell tools with pagination, fallback matching, and smarter output#1895
Merged
enhance: improve filesystem & shell tools with pagination, fallback matching, and smarter output#1895
Conversation
…atching, and smarter output
This was referenced Mar 12, 2026
sorker
pushed a commit
to sorker/nanobot
that referenced
this pull request
Mar 24, 2026
…agination, fallback matching, and smarter output enhance: improve filesystem & shell tools with pagination, fallback matching, and smarter output
Wattysaid
pushed a commit
to kieran-assistant/nanobot
that referenced
this pull request
Apr 3, 2026
…agination, fallback matching, and smarter output enhance: improve filesystem & shell tools with pagination, fallback matching, and smarter output
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
Enhance the core filesystem and shell tools to close feature gaps identified by comparing with opencode's tool implementations.
Changes
ReadFileTool
offset(1-indexed) andlimitparameters for line-based pagination{n}| {content}format_MAX_CHARS = 128K) trims from end when output is too largeUse offset=N to continue)EditFileTool
_find_match():replace_allparameter for bulk replacementsListDirTool
recursivemode usingrglob("*")for deep directory explorationmax_entriescap (default 200) with truncation message_IGNORE_DIRSset auto-skips.git,node_modules,__pycache__,.venv, etc.ExecTool
timeoutparameter to the LLM (1–600s), capped at_MAX_TIMEOUTCode quality
_FsToolbase class to eliminate duplicated__init__and path resolution across all 4 filesystem tool classesTest plan
tests/test_filesystem_tools.py— 18 tests covering:ReadFileTool: pagination, line numbers, offset bounds, empty file, char budget trimming_find_match: exact, no-match, CRLF, line-trim fallback, multiple candidatesEditFileTool: exact edit, CRLF preservation, trim fallback, ambiguous warning, replace_all, not-foundListDirTool: basic list, recursive, ignore dirs, max_entries truncation, empty dir, not-foundtests/test_tool_validation.py— 4 new tests covering:_MAX_TIMEOUT