mirror of
https://github.com/pydantic/pydantic-ai-harness.git
synced 2026-07-21 02:45:34 +00:00
Prevent search result format from becoming a return type
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user