Prevent search result format from becoming a return type

This commit is contained in:
Aditya Vardhan
2026-07-16 13:55:31 +05:30
parent 73513a60bc
commit dc83b13151
2 changed files with 12 additions and 1 deletions
+1 -1
View File
@@ -363,7 +363,7 @@ class FileSystemToolset(FunctionToolset[AgentDepsT]):
include_glob: If provided, only search files matching this glob (e.g. '*.py').
Returns:
Matching lines formatted as file:line_number:text.
str: Matching lines formatted as file:line_number:text.
"""
# See list_directory: the search root isn't gated by allowed_patterns;
# matched files are filtered per-entry below.
+11
View File
@@ -1050,6 +1050,17 @@ class TestFileSystemCapability:
toolset = fs.get_toolset()
assert isinstance(toolset, FileSystemToolset)
def test_search_files_description_has_string_return_type(self) -> None:
description = FileSystem().get_toolset().tools['search_files'].description
assert description == (
'<summary>Search file contents using a regular expression.</summary>\n'
'<returns>\n'
'<type>str</type>\n'
'<description>Matching lines formatted as file:line_number:text.</description>\n'
'</returns>'
)
def test_protected_defaults(self) -> None:
fs = FileSystem()
assert '.git/*' in fs.protected_patterns