Skip to content

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

Merged
rekram1-node merged 1 commit into
anomalyco: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 into
anomalyco: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
balcsida pushed a commit to balcsida/opencode that referenced this pull request Apr 8, 2026
xywsxp pushed a commit to xywsxp/opencode that referenced this pull request Apr 24, 2026
Rwanbt pushed a commit to Rwanbt/unifia that referenced this pull request May 5, 2026
AIALRA-0 pushed a commit to AIALRA-0/opencode-turn-engine that referenced this pull request Jun 10, 2026
AIALRA-0 pushed a commit to AIALRA-0/opencode-turn-engine that referenced this pull request Jun 10, 2026
avion23 pushed a commit to avion23/opencode that referenced this pull request Jun 10, 2026
Rwanbt pushed a commit to Rwanbt/unifia that referenced this pull request Jun 14, 2026
MarsQiu007 referenced this pull request in MarsQiu007/openNovel Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants