Skip to content

docs: rename patch tool to apply_patch and clarify apply_patch behavior#19979

Merged
rekram1-node merged 1 commit intoanomalyco:devfrom
yejiming:jimmy/2026-03-30
Mar 30, 2026
Merged

docs: rename patch tool to apply_patch and clarify apply_patch behavior#19979
rekram1-node merged 1 commit intoanomalyco:devfrom
yejiming:jimmy/2026-03-30

Conversation

@yejiming
Copy link
Copy Markdown
Contributor

Issue for this PR

Closes #19941

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

This PR fixes the built-in tool naming mismatch in the Tools docs.

Previously, the docs listed the patching tool as patch, but the actual registered tool ID is apply_patch. That mismatch caused plugin hooks checking input.tool === "patch" to never fire.

Changes made:

  • Renamed the built-in tool section heading from patch to apply_patch.
  • Updated permission notes to reference apply_patch instead of patch.
  • Added explicit hook guidance to use input.tool === "apply_patch".
  • Documented the apply_patch args shape:
    • Uses output.args.patchText
    • Does not expose output.args.filePath
    • Paths are embedded in marker lines and are relative to project root.

Why this works:

  • It aligns documentation with the actual tool registry name in source.
  • It prevents silent plugin hook failures due to incorrect tool ID checks.
  • It clarifies how to parse file paths from patchText, matching runtime behavior.

How did you verify your code works?

  • Reviewed and updated the relevant section in packages/web/src/content/docs/tools.mdx.
  • Verified all changed references consistently use apply_patch.

Screenshots / recordings

Not applicable (documentation-only change).

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@rekram1-node rekram1-node merged commit ee018d5 into anomalyco:dev Mar 30, 2026
11 checks passed
@yejiming yejiming deleted the jimmy/2026-03-30 branch March 30, 2026 06:24
loocor pushed a commit to loocor/opencode that referenced this pull request Mar 30, 2026
afanty2021 pushed a commit to afanty2021/opencode that referenced this pull request Mar 30, 2026
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: docs list built-in tool as patch, source registers it as apply_patch

2 participants