Skip to content

docs: Update file-editing.mdx for fuzzy matching ladder + apply_patch tool#814

Merged
MervinPraison merged 1 commit into
mainfrom
claude/issue-808-20260623-1136
Jun 23, 2026
Merged

docs: Update file-editing.mdx for fuzzy matching ladder + apply_patch tool#814
MervinPraison merged 1 commit into
mainfrom
claude/issue-808-20260623-1136

Conversation

@MervinPraison

Copy link
Copy Markdown
Owner

Summary

Updates docs/features/file-editing.mdx to document the two new capabilities from upstream PraisonAI PR #2177:

  • Fuzzy matching ladder in edit_file — 5-strategy ladder (exact → line_trimmed → whitespace_normalised → indentation_flexible → block_anchor) with Mermaid diagram, strategy table, confidence guards, and code example
  • New apply_patch tool — atomic multi-file Add/Update/Delete with chooser diagram, patch format reference, atomicity guarantees, sequence diagram, and full error matrix

All error message strings verified verbatim from upstream praisonaiagents/tools/edit_tools.py.

Changes

  • docs/features/file-editing.mdx — 240 lines added across new sections

Acceptance Criteria

  • 5-strategy fuzzy ladder documented with Mermaid diagram and table
  • apply_patch documented with patch-format reference, atomicity guarantees, and error matrix
  • Chooser diagram for edit_file vs apply_patch
  • Agent-centric Quick Start examples for both capabilities
  • Existing precise-edit guidance preserved
  • Error messages quoted verbatim from source
  • No changes under docs/concepts/

Fixes #808

Generated with Claude Code

… 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-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@MervinPraison, we couldn't start this review because you've reached your PR review rate limit.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: cf5d380e-f99f-4433-b0d5-ba925e6d7092

📥 Commits

Reviewing files that changed from the base of the PR and between e201d44 and 5e7ebdb.

📒 Files selected for processing (1)
  • docs/features/file-editing.mdx
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/issue-808-20260623-1136

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 |

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

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.

Comment on lines +136 to +138
## 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.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

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.

@mintlify

mintlify Bot commented Jun 23, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
praisonai 🟢 Ready View Preview Jun 23, 2026, 11:47 AM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@MervinPraison MervinPraison merged commit d8f7d40 into main Jun 23, 2026
20 checks passed
@MervinPraison MervinPraison deleted the claude/issue-808-20260623-1136 branch June 23, 2026 12:21
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.

docs: Update file-editing.mdx for fuzzy matching ladder + document new apply_patch tool (from PraisonAI #2177)

1 participant