Skip to content

Commit b537726

Browse files
committed
Help the LLM find out which pattern it can use
Signed-off-by: David Gageot <[email protected]>
1 parent 30b08e0 commit b537726

File tree

6 files changed

+28
-68
lines changed

6 files changed

+28
-68
lines changed

e2e/cagent_exec_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ func TestExec_OpenAI(t *testing.T) {
2121
func TestExec_OpenAI_ToolCall(t *testing.T) {
2222
out := cagentExec(t, "testdata/fs_tools.yaml", "How many files in testdata/working_dir? Only output the number.")
2323

24-
require.Equal(t, "\n--- Agent: root ---\n\nCalling search_files(\n path: \"testdata/working_dir\"\n pattern: \"*\"\n)\n\nsearch_files response → \"2 files found:\\ntestdata/working_dir\\ntestdata/working_dir/README.me\"\n\n2", out)
24+
require.Equal(t, "\n--- Agent: root ---\n\nCalling search_files(\n path: \"testdata/working_dir\"\n pattern: \"*.*\"\n)\n\nsearch_files response → \"1 files found:\\ntestdata/working_dir/README.me\"\n\n1", out)
2525
}
2626

2727
func TestExec_OpenAI_gpt5(t *testing.T) {
@@ -75,7 +75,7 @@ func TestExec_Mistral(t *testing.T) {
7575
func TestExec_Mistral_ToolCall(t *testing.T) {
7676
out := cagentExec(t, "testdata/fs_tools.yaml", "--model=mistral/mistral-small", "How many files in testdata/working_dir? Only output the number.")
7777

78-
require.Equal(t, "\n--- Agent: root ---\n\nCalling list_directory(path: \"testdata/working_dir\")\n\nlist_directory response → \"FILE README.me\\n\"\n\n1", out)
78+
require.Equal(t, "\n--- Agent: root ---\n\nCalling list_directory(path: \"testdata/working_dir\")\n\nlist_directory response → \"FILE README.me\\n\"\n\n2", out)
7979
}
8080

8181
func TestExec_ToolCallsNeedAcceptance(t *testing.T) {

e2e/testdata/cassettes/TestExec_Anthropic_ToolCall.yaml

Lines changed: 7 additions & 47 deletions
Large diffs are not rendered by default.

e2e/testdata/cassettes/TestExec_Gemini_ToolCall.yaml

Lines changed: 6 additions & 6 deletions
Large diffs are not rendered by default.

e2e/testdata/cassettes/TestExec_Mistral_ToolCall.yaml

Lines changed: 6 additions & 6 deletions
Large diffs are not rendered by default.

e2e/testdata/cassettes/TestExec_OpenAI_ToolCall.yaml

Lines changed: 6 additions & 6 deletions
Large diffs are not rendered by default.

pkg/tools/builtin/filesystem.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ func (t *FilesystemTool) Tools(context.Context) ([]tools.Tool, error) {
328328
{
329329
Name: ToolNameSearchFiles,
330330
Category: "filesystem",
331-
Description: "Recursively search for files and directories matching a pattern. Prints the full paths of matching files and the total number of files found.",
331+
Description: "Recursively search for files and directories matching a pattern. Prints the full paths of matching files and the total number of files found. The pattern syntax is the same as Go's filepath.Match.",
332332
Parameters: tools.MustSchemaFor[SearchFilesArgs](),
333333
OutputSchema: tools.MustSchemaFor[string](),
334334
Handler: t.handleSearchFiles,

0 commit comments

Comments
 (0)