Release v6.6.7#111
Conversation
feat(search_files): FFF-backed search with ripgrep fallback, pagination, and compact results - Add src/services/search-files (index/format/types) as the single entry point: tries FFF, falls back to streaming ripgrep, formats a compact Engine/Matches/Next-cursor page with at most three matches per file. - Add src/services/fff wrapping the ESM-only @ff-labs/fff-node SDK via a dynamic import, caching up to three FileFinder instances, encoding the user regex for FFF's query parser, and continuing through pages until .orbitalignore-filtered matches fill the requested page. - Add searchFilesWithRipgrep streaming JSON ripgrep output, applying .orbitalignore before the page budget, enforcing the per-file cap, and returning an engine-scoped cursor. - Add cursor, max_results (1-100, default 50), and context_lines (0-2, default 0) params to both XML and native JSON search_files schemas; cursors are engine-scoped (fff:<offset> / ripgrep:<offset>). - Rework searchFilesTool to parse the new params and delegate to searchFiles; extend toolParamNames and SearchFilesToolUse. - esbuild.mjs copies FFF runtime packages under dist/fff/node_modules; root package.json declares pnpm.supportedArchitectures for all platform FFF binaries. - extension.ts disposes FFF finders and closes the native library on deactivate. - Rewrite the search_files system prompt and capabilities section for compact, paginated matches. - ChatRow shows the file_pattern for search_files rows. - Bump extension version to 6.6.7. - Add tests for FFF, ripgrep fallback, search-files orchestration, and cursor/format helpers. Co-authored-by: matterai-app[bot] <matterai-app[bot]@users.noreply.github.com>
ContextThis release refines the FFF (Fast File Finder) integration by addressing a reliability issue where transient native library load failures would permanently disable the high-performance search engine for the duration of a session. ImplementationAdded a Screenshots
How to Test
Summary By MatterAI
🔄 What ChangedImplemented error recovery for the FFF native module loader. The system now resets the internal module promise on rejection, preventing a single failed import from permanently degrading the search experience to ripgrep for the entire session. 🔍 Impact of the ChangeImproves system resilience and search performance reliability. Users will no longer be locked into the slower ripgrep fallback if a transient environment issue occurs during the initial FFF load attempt. 📁 Total Files ChangedClick to Expand
🧪 Test Added/RecommendedRecommended
🔒 Security VulnerabilitiesN/A. This is a logic-level reliability fix for internal module loading. Caution Package Vulnerabilities
|
There was a problem hiding this comment.
🧪 PR Review is completed: Release v6.6.7 introduces a new FFF-based search engine with ripgrep fallback, paginated cursors, and compact output formatting. Two issues found: FFF module load failures are never retried, and non-integer search options can reach native APIs.
Skipped files
CHANGELOG.md: Skipped file patternpnpm-lock.yaml: Skipped file pattern
⬇️ Low Priority Suggestions (1)
src/services/search-files/types.ts (1 suggestion)
Location:
src/services/search-files/types.ts(Lines 47-48)🟡 Type Safety
Issue:
clampSearchOptionsdoes not floormaxResultsorcontextLines. If the AI passes a fractional value like"50.5",Number("50.5")produces50.5which passes throughclampSearchOptionsand reaches the FFF native API aspageSize: 50.5and the ripgrep comparator. Native FFI APIs typically expect integer page sizes, which could cause undefined behavior or errors.Fix: Apply
Math.floorinclampSearchOptionsto guarantee integer values.Impact: Prevents fractional values from reaching native APIs and ensures consistent integer page sizes across both search engines.
- maxResults: Math.min(Math.max(options.maxResults ?? DEFAULT_SEARCH_RESULTS, 1), MAX_SEARCH_RESULTS), - contextLines: Math.min(Math.max(options.contextLines ?? 0, 0), MAX_SEARCH_CONTEXT_LINES), + maxResults: Math.min(Math.max(Math.floor(options.maxResults ?? DEFAULT_SEARCH_RESULTS), 1), MAX_SEARCH_RESULTS), + contextLines: Math.min(Math.max(Math.floor(options.contextLines ?? 0), 0), MAX_SEARCH_CONTEXT_LINES),
Reset fffModulePromise to undefined when the dynamic import rejects, so the next search_files call retries FFF instead of permanently caching a rejected promise and degrading to ripgrep for the rest of the session. Co-authored-by: matterai-app[bot] <matterai-app[bot]@users.noreply.github.com>
|
✅ Reviewed the changes: The PR correctly adds a |
Release v6.6.7
FFF-backed
search_fileswith ripgrep fallback, pagination, and compact results.Added
search_fileswith ripgrep fallback.search_filesnow runs through the native@ff-labs/fff-nodefile finder first, falling back to a streaming ripgrep implementation when FFF is unavailable or fails. Results are compact (at most three matches per file), paginated, and capped at a configurable page size so the model reads only the relevant regions instead of a context-flooding dump.src/services/search-filesmodule (index.ts,format.ts,types.ts) is the single entry point: it tries FFF, falls back to ripgrep, and formats a compactEngine / Matches / Next cursorpage.src/services/fff/index.tswraps the ESM-only FFF SDK, keeps it out of the CommonJS bundle via a dynamicimport(), caches up to threeFileFinderinstances per base path, encodes the user regex for FFF's query parser, and continues through FFF pages until.orbitalignore-filtered matches fill the requested page.searchFilesWithRipgrepinsrc/services/ripgrep/index.tsstreams JSON ripgrep output, applies.orbitalignorebefore consuming the page budget, enforces the per-file match cap, and returns a ripgrep-engine cursor for continuation.cursor,max_results(1-100, default 50), andcontext_lines(0-2, default 0) parameters on both the XML and native JSONsearch_filestool schemas; cursors are engine-scoped (fff:<offset>/ripgrep:<offset>) and validated byparseSearchCursor/normalizeNullableSearchString.searchFilesToolnow parses the new params and delegates tosearchFiles;toolParamNamesandSearchFilesToolUseextended accordingly.esbuild.mjscopies the FFF runtime packages (and their platform-specific native libraries) underdist/fff/node_modulesso the packaged extension can resolve the native SDK; rootpackage.jsondeclarespnpm.supportedArchitecturesso all platform FFF binaries install.extension.tsdisposes FFF finders and closes the native library on deactivate.Changed
search_filessystem prompt rewritten. The tool description and capabilities section now describe compact, paginated matches and direct the model to read the relevant file region rather than relying on large context windows. The verbosefile_patternquoting examples were removed in favor of a concise parameter list.ChatRowshows thefile_patternforsearch_filesrows. Parallel searches are now distinguishable in the chat history by their glob, rendered as a<code>chip next to the regex.ChatViewpinned-todo container padding aligned with the sharedmx-3.5chat column padding.Version bump
src/package.jsonbumped from6.6.5to6.6.7.pnpm lintpnpm check-types