Skip to content

Release v6.6.7#111

Merged
code-crusher merged 3 commits into
mainfrom
release/v6.6.7
Jul 22, 2026
Merged

Release v6.6.7#111
code-crusher merged 3 commits into
mainfrom
release/v6.6.7

Conversation

@code-crusher

Copy link
Copy Markdown
Member

Release v6.6.7

FFF-backed search_files with ripgrep fallback, pagination, and compact results.

Added

  • FFF-backed search_files with ripgrep fallback. search_files now runs through the native @ff-labs/fff-node file 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.
    • New src/services/search-files module (index.ts, format.ts, types.ts) is the single entry point: it tries FFF, falls back to ripgrep, and formats a compact Engine / Matches / Next cursor page.
    • New src/services/fff/index.ts wraps the ESM-only FFF SDK, keeps it out of the CommonJS bundle via a dynamic import(), caches up to three FileFinder instances 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.
    • New searchFilesWithRipgrep in src/services/ripgrep/index.ts streams JSON ripgrep output, applies .orbitalignore before consuming the page budget, enforces the per-file match cap, and returns a ripgrep-engine cursor for continuation.
    • New cursor, max_results (1-100, default 50), and context_lines (0-2, default 0) parameters on both the XML and native JSON search_files tool schemas; cursors are engine-scoped (fff:<offset> / ripgrep:<offset>) and validated by parseSearchCursor / normalizeNullableSearchString.
    • searchFilesTool now parses the new params and delegates to searchFiles; toolParamNames and SearchFilesToolUse extended accordingly.
    • esbuild.mjs copies the FFF runtime packages (and their platform-specific native libraries) under dist/fff/node_modules so the packaged extension can resolve the native SDK; root package.json declares pnpm.supportedArchitectures so all platform FFF binaries install.
    • extension.ts disposes FFF finders and closes the native library on deactivate.
    • Tests for the FFF wrapper, ripgrep fallback, search-files orchestration, and cursor/format helpers.

Changed

  • search_files system 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 verbose file_pattern quoting examples were removed in favor of a concise parameter list.
  • ChatRow shows the file_pattern for search_files rows. Parallel searches are now distinguishable in the chat history by their glob, rendered as a <code> chip next to the regex.
  • Pinned todo list horizontal padding. ChatView pinned-todo container padding aligned with the shared mx-3.5 chat column padding.

Version bump

src/package.json bumped from 6.6.5 to 6.6.7.


  • pnpm lint
  • pnpm check-types

matterai-app Bot added 2 commits July 23, 2026 01:13
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>
@matterai-app

matterai-app Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Context

This 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.

Implementation

Added a .catch block to the dynamic import() call for the FFF native module. If the promise rejects, the cached fffModulePromise is reset to undefined before re-throwing the error. This ensures that subsequent calls attempt to reload the library rather than returning a permanently rejected promise.

Screenshots

before after
N/A N/A

How to Test

  1. Simulate a transient failure by temporarily blocking access to the native binary.
  2. Trigger a search and observe the failure/fallback.
  3. Restore access to the binary.
  4. Trigger another search and verify that the FFF engine successfully initializes without a session restart.

Summary By MatterAI MatterAI logo

🔄 What Changed

Implemented 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 Change

Improves 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 Changed

Click to Expand
File ChangeLog
src/services/fff/index.ts Resilient Loading: Added catch-and-reset logic to the native module import promise.

🧪 Test Added/Recommended

Recommended

  • Unit Test: Mock the dynamic import() to reject once and then resolve, verifying that the service successfully recovers on the second call.

🔒 Security Vulnerabilities

N/A. This is a logic-level reliability fix for internal module loading.

Caution

Package Vulnerabilities

Package Version Severity CVE Fix Version Vulnerability
esbuild ^0.25.0 HIGH GHSA-gv7w-rqvm-qjhr 0.28.1 Withdrawn Advisory: esbuild:
Missing binary
integrity verification
in Deno
module enables
remote code
execution via
NPM_CONFIG_REGISTRY
glob ^11.0.3 HIGH CVE-2025-64756 11.1.0 glob CLI: Command
injection via
-c/--cmd executes
matches with
shell:true
turbo ^2.5.6 MODERATE CVE-2026-45773
CVE-2026-45772
2.9.14 Turbo: Login callback
CSRF/session fixation


Turbo: Unexpected local
code execution
during Yarn
Berry detection

@matterai-app matterai-app Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧪 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 pattern
  • pnpm-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: clampSearchOptions does not floor maxResults or contextLines. If the AI passes a fractional value like "50.5", Number("50.5") produces 50.5 which passes through clampSearchOptions and reaches the FFF native API as pageSize: 50.5 and the ripgrep comparator. Native FFI APIs typically expect integer page sizes, which could cause undefined behavior or errors.

Fix: Apply Math.floor in clampSearchOptions to 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),

Comment thread src/services/fff/index.ts Outdated
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>
@matterai-app

matterai-app Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

✅ Reviewed the changes: The PR correctly adds a .catch() handler to reset fffModulePromise on rejection, addressing the transient failure retry issue. The implementation is sound with no new issues introduced.

@code-crusher
code-crusher merged commit 8d79f2d into main Jul 22, 2026
2 of 8 checks passed
@code-crusher
code-crusher deleted the release/v6.6.7 branch July 22, 2026 21:27
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