docs: Update file-editing.mdx for fuzzy matching ladder + apply_patch tool#814
Conversation
… tool (fixes #808) - Add 5-strategy fuzzy matching ladder diagram and strategy table to edit_file docs - Add 'How Fuzzy Matching Works' section with confidence guards and code example - Add fuzzy match callout explaining agent benefits (fewer retry turns) - Update 'Ambiguous match' error note to cover fuzzy multi-candidate case - Add 'Multi-file Patches with apply_patch' section with chooser diagram - Add apply_patch Quick Start (agent-centric + SDK direct examples) - Add patch format reference, update hunk syntax, atomicity guarantees table - Add apply_patch atomicity sequence diagram with rollback flow - Add apply_patch error matrix with verbatim error strings from source - Update How It Works sequence diagram to mention fuzzy ladder - Update operation risk table to include apply_patch row - Update Configuration Options table with apply_patch function row - Add Atomic Multi-file Rename common pattern example - Add two new Best Practices accordions for apply_patch usage 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> Co-authored-by: Mervin Praison <MervinPraison@users.noreply.github.com>
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
|
Warning Review limit reached
More reviews will be available in 16 minutes and 39 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. For paid Pro and Pro+ PR reviews, CodeRabbit uses rolling per-developer review limits. Reviews become available again as older review attempts age out of the rolling limit window. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request updates the documentation in docs/features/file-editing.mdx to describe a new fuzzy matching ladder for edit_file and introduces the apply_patch tool for atomic multi-file operations. However, feedback indicates that neither the fuzzy matching logic nor the apply_patch tool are currently implemented or exported in the codebase, which would lead to import errors and mislead users. It is recommended to either include these implementations in this pull request or defer the documentation updates.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| | **edit_file** | High | Recommended | Precise find-and-replace with ambiguity & staleness guards | | ||
| | **edit_file** | High | Recommended | Precise find-and-replace with fuzzy ladder, ambiguity & staleness guards | | ||
| | **write_file** | High | Recommended | Create/overwrite files | | ||
| | **apply_patch** | High | Recommended | Atomic multi-file Add/Update/Delete with rollback | |
There was a problem hiding this comment.
The documentation references apply_patch as an available tool in praisonaiagents.tools.edit_tools. However, apply_patch is not implemented or exported in praisonaiagents/tools/edit_tools.py in this codebase. Importing or using this tool will result in an ImportError. Please ensure the implementation of apply_patch is included in this pull request, or remove/defer this documentation until the feature is implemented.
| ## How Fuzzy Matching Works | ||
|
|
||
| `edit_file` walks a deterministic ladder of matching strategies and stops at the **first** strategy that produces a confident match. Exact matches always win; fuzzy strategies only engage when an exact substring is not found. Existing code keeps behaving exactly as before — only previously-failing edits now succeed. |
There was a problem hiding this comment.
This section describes a 5-strategy fuzzy matching ladder for edit_file. However, the current implementation of edit_file in praisonaiagents/tools/edit_tools.py only supports exact matching (via old_string not in content and content.replace). Documenting fuzzy matching behavior that is not yet implemented will mislead users and lead to unexpected edit failures. Please verify if the fuzzy matching implementation needs to be merged alongside these documentation updates.
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
Summary
Updates
docs/features/file-editing.mdxto document the two new capabilities from upstream PraisonAI PR #2177:edit_file— 5-strategy ladder (exact → line_trimmed → whitespace_normalised → indentation_flexible → block_anchor) with Mermaid diagram, strategy table, confidence guards, and code exampleapply_patchtool — atomic multi-file Add/Update/Delete with chooser diagram, patch format reference, atomicity guarantees, sequence diagram, and full error matrixAll error message strings verified verbatim from upstream
praisonaiagents/tools/edit_tools.py.Changes
docs/features/file-editing.mdx— 240 lines added across new sectionsAcceptance Criteria
apply_patchdocumented with patch-format reference, atomicity guarantees, and error matrixedit_filevsapply_patchdocs/concepts/Fixes #808
Generated with Claude Code