From 39851ba0362dc5a652328c360058a0f4def2e91d Mon Sep 17 00:00:00 2001 From: pragneshbagary Date: Wed, 19 Nov 2025 14:19:32 +0530 Subject: [PATCH] Fix #4173: glob returns an error instead of an empty list Signed-off-by: pragneshbagary --- hack/bats/tests/mcp.bats | 3 +-- pkg/mcp/toolset/filesystem.go | 3 +++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/hack/bats/tests/mcp.bats b/hack/bats/tests/mcp.bats index 85e91600251..74f063d81cc 100644 --- a/hack/bats/tests/mcp.bats +++ b/hack/bats/tests/mcp.bats @@ -296,8 +296,7 @@ tools_call() { } @test 'glob returns an empty list when the pattern does not match' { - skip "see https://github.com/lima-vm/lima/issues/4173" - + tools_call glob '{"pattern":"nothing.to.see"}' run_yq '.structuredContent.matches[]' <<<"$output" diff --git a/pkg/mcp/toolset/filesystem.go b/pkg/mcp/toolset/filesystem.go index 1df4b088b58..92d0dc89638 100644 --- a/pkg/mcp/toolset/filesystem.go +++ b/pkg/mcp/toolset/filesystem.go @@ -130,6 +130,9 @@ func (ts *ToolSet) Glob(_ context.Context, } pattern := path.Join(guestPath, args.Pattern) matches, err := ts.sftp.Glob(pattern) + if matches == nil { + matches = []string{} + } if err != nil { return nil, nil, err }