Skip to content

fix(file): bound fallback text search - #67

Open
wylangyue wants to merge 1 commit into
uvwt:mainfrom
wylangyue:fix/search-text-resource-limits
Open

fix(file): bound fallback text search#67
wylangyue wants to merge 1 commit into
uvwt:mainfrom
wylangyue:fix/search-text-resource-limits

Conversation

@wylangyue

Copy link
Copy Markdown

Summary:

  • use the Go fallback only when ripgrep is unavailable instead of silently retrying every ripgrep failure
  • cap fallback traversal at 100,000 entries, 10,000 files, 4 MiB per file, 128 MiB total, and 10 seconds
  • skip non-regular and oversized files while reporting partial-result accounting
  • map cancellation, timeout, resource exhaustion, regex errors, and internal failures to structured tool errors

This prevents broad searches from performing unbounded full-file reads and avoids leaking raw transport failures when the request is canceled or a resource budget is exhausted.

Tests:

  • go test ./internal/tool/file ./internal/app ./internal/mcp

@wylangyue
wylangyue force-pushed the fix/search-text-resource-limits branch from 264ae19 to 7b95714 Compare September 6, 2026 05:49
@wylangyue
wylangyue force-pushed the fix/search-text-resource-limits branch from 7b95714 to 154931a Compare September 6, 2026 11:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant