Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Feb 2, 2026

Related GitHub Issue

Closes: #11087

Roo Code Task Context (Optional)

N/A

Description

This PR adds a user-configurable fuzzy match threshold setting to address the issue where models like gemini-2-flash-preview produce output with 89-96% similarity that fails with the hardcoded 100% exact match threshold.

Key implementation details:

  • Added fuzzyMatchThreshold to the GlobalSettings schema in packages/types/src/global-settings.ts (0-1 range, optional)
  • Updated TaskOptions interface and Task constructor to accept and pass the threshold to MultiSearchReplaceDiffStrategy
  • Added a slider UI control in ContextManagementSettings.tsx allowing users to adjust the threshold from 80-100%
  • Added English translations for the new setting with helpful description text

Design choices:

  • The slider range is 80-100% to prevent users from setting dangerously low thresholds that could cause incorrect matches
  • Default remains at 100% (exact match) for backward compatibility
  • The setting is placed in Context Management settings since it relates to how file edits are processed

Test Procedure

  1. Open Roo Code settings
  2. Navigate to "Context Management" section
  3. Locate the "Fuzzy match threshold for file edits" slider
  4. Adjust the slider and verify it saves correctly
  5. Test with a model that produces slightly different output (like gemini-2-flash-preview) and verify edits work at lower thresholds

Pre-Submission Checklist

  • Issue Linked: This PR is linked to an approved GitHub Issue (see "Related GitHub Issue" above).
  • Scope: My changes are focused on the linked issue (one major feature/fix per PR).
  • Self-Review: I have performed a thorough self-review of my code.
  • Testing: New and/or updated tests have been added to cover my changes (if applicable).
  • Documentation Impact: I have considered if my changes require documentation updates (see "Documentation Updates" section below).
  • Contribution Guidelines: I have read and agree to the Contributor Guidelines.

Screenshots / Videos

N/A - UI change is a simple slider control similar to existing sliders in the same settings panel.

Documentation Updates

  • No documentation updates are required.
  • Yes, documentation updates are required. User documentation should mention the new "Fuzzy match threshold for file edits" setting in Context Management.

Additional Notes

This implementation restores the ability to configure the fuzzy match threshold that was previously available but was removed/hardcoded to 100%. The setting allows models that produce minor formatting variations to still successfully edit files.

Get in Touch

N/A - automated PR


Important

Introduces a user-configurable fuzzy match threshold setting to allow flexible file edits, with schema, UI, and task handling updates.

  • Behavior:
    • Adds fuzzyMatchThreshold to global-settings.ts schema (0-1 range, optional).
    • Updates TaskOptions and Task constructor in Task.ts to handle fuzzyMatchThreshold.
    • Adds slider in ContextManagementSettings.tsx for threshold adjustment (80-100%).
  • UI:
    • Adds English translations for fuzzy match setting in settings.json.
    • Integrates fuzzyMatchThreshold into SettingsView.tsx and ContextManagementSettings.tsx.
  • Design:
    • Slider range set to 80-100% to prevent low thresholds.
    • Default remains 100% for backward compatibility.

This description was created by Ellipsis for 27c47c0. You can customize this summary. It will automatically update as commits are pushed.

- Add fuzzyMatchThreshold to GlobalSettings schema (0-1 range, optional)
- Update Task class to accept and pass threshold to MultiSearchReplaceDiffStrategy
- Add UI slider control in ContextManagementSettings (80-100% range)
- Add English translations for the new setting

This allows users to adjust how strictly search content must match when
editing files, addressing issues where models like gemini-2-flash-preview
produce output with 89-96% similarity that fails with 100% exact match.

Fixes #11087
@roomote
Copy link
Contributor Author

roomote bot commented Feb 2, 2026

Rooviewer Clock   See task on Roo Cloud

Review complete. No issues identified.

The implementation correctly adds a user-configurable fuzzy match threshold setting with proper type definitions, state management, and UI controls. The code follows established patterns in the codebase.

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

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.

[BUG] gemini-2-flash-preview can't edit files anymore after upgrading from Roo Code 3.38.3 to 3.45.0

1 participant