docs(plugins): dispatch_tool example names a real tool (write_file), not file_edit - #109714
Open
MaxFreedomPollard wants to merge 1 commit into
Open
MaxFreedomPollard wants to merge 1 commit into
MaxFreedomPollard wants to merge 1 commit into
Conversation
…not file_edit The `ctx.dispatch_tool()` section tells plugin authors to "call `file_edit`" (:1207) and lists `"file_edit"` as an example of a "Tool name as registered in the tool registry" (:1232). There is no `file_edit` tool: `discover_builtin_tools()` + `registry.get_all_tool_names()` returns 89 names, and the file-writing ones are `write_file` and `patch`. That matters because dispatch is registry-bound — website/docs/user-guide/features/hooks.md:1296 says `PluginContext.dispatch_tool()` "can only call tools registered in the tool registry" — so an author who copies the example gets an unknown-tool failure. The same page already uses real names at :529 (`terminal`, `read_file`). Use `write_file` in both mentions and in the zh-Hans mirror. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
The "Dispatch tools from slash commands" section of the plugin guide points authors at a tool that does not exist.
website/docs/developer-guide/plugins/index.md:1207:and the parameter table for the same call,
:1232:There is no
file_edittool. Asking the registry directly:file_edithas zero occurrences anywhere in the repo outside these doc lines (the only other hits arefile_editor, OpenHands' own tool name, in the OpenHands skill docs).This is not a cosmetic naming slip, because dispatch is registry-bound:
website/docs/user-guide/features/hooks.md:1296states thatPluginContext.dispatch_tool()"can only call tools registered in the tool registry" — that sentence is the reasonsend_messageis deliberately absent. An author who copies the:1232row, which explicitly promises "Tool name as registered in the tool registry", gets an unknown-tool failure at dispatch time with nothing in the docs to explain it.The same page already uses real names everywhere else —
:529("invoketerminal,read_file, or any other tool"), the:538example (ctx.dispatch_tool("terminal", …)),:1249(kanban_*,delegate_task,terminal,read_file),:1257(kanban_comment) — sofile_editis the lone invented name in the section.write_fileis the substitute: it is the registered file-writing tool, and it reads naturally in "spawn a subagent viadelegate_task, callwrite_file". (patchwould have worked too;write_fileis the closer match for a doc that had "edit a file" in mind and is the more commonly dispatched of the two.) Text only, no behavior change.Related Issue
None — found while checking the plugin guide's dispatch examples against
tools.registry. No open PR touches these lines:gh pr list --repo NousResearch/hermes-agent --search "file_edit" --state openreturns nothing, and thedispatch_tool/plugins dispatch toolsearches return only code PRs (the most recent, #109632 and #109441, change hook execution, not this page).Type of Change
Changes Made
website/docs/developer-guide/plugins/index.md:1207— prose example:file_edit→write_file.website/docs/developer-guide/plugins/index.md:1232—dispatch_tool(name=…)parameter table:"file_edit"→"write_file".website/i18n/zh-Hans/.../developer-guide/plugins/index.md:735and:760— the same two renames in the mirror; Chinese prose untouched, only the identifier inside the backticks changed.The
:1232/:760table rows were not in the original report but are the same defect in the same section, one screen below the prose line — fixing only the prose would have left the stronger version of the false claim ("as registered in the tool registry") standing. The runnable code block at:1212already dispatchesdelegate_taskand needed no change.How to Test
Registry proof — run the snippet above in the project venv:
file_editis absent from all 89 registered tools;write_file,patchanddelegate_taskare present.No invented tool name is left in the docs:
The single remaining hit is OpenHands'
file_editor, correctly left alone.Dispatch the documented call for real (interactive CLI, any loaded plugin):
ctx.dispatch_tool("write_file", {"file_path": "/tmp/x.txt", "content": "hi"})writes the file;ctx.dispatch_tool("file_edit", …)fails as an unregistered tool, which is what the old docs told authors to write.Docs tests still pass:
scripts/run_tests.sh tests/website→ 38 passed, 0 failed.Checklist
Code
fix(scope):,feat(scope):, etc.)file_edit; the opendispatch_toolPRs (fix(cli): wire plugin manager _cli_ref in query mode so dispatch_tool injects parent_agent (#67597) #67611, feat(plugins): bind slash commands to session context #106467, fix: restrict PluginContext for user-loaded plugins #34053, fix(cli): expose _cli_ref to plugins before query-mode agent init #67633) change CLI/plugin-context wiring and none edit this pagescripts/run_tests.sh:tests/website→ 38 passedregistry.get_all_tool_names()would have caught this and is worth having; happy to open it separately if the maintainers want itDocumentation & Housekeeping
cli-config.yaml.exampleif I added/changed config keys — N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — N/A