Skip to content

docs(plugins): dispatch_tool example names a real tool (write_file), not file_edit - #109714

Open
MaxFreedomPollard wants to merge 1 commit into
NousResearch:mainfrom
MaxFreedomPollard:docs/plugins-dispatch-tool-real-name
Open

MaxFreedomPollard wants to merge 1 commit into
NousResearch:mainfrom
MaxFreedomPollard:docs/plugins-dispatch-tool-real-name

Conversation

@MaxFreedomPollard

Copy link
Copy Markdown
Contributor

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:

Slash command handlers that need to orchestrate tools (spawn a subagent via delegate_task, call file_edit, etc.) should use ctx.dispatch_tool() …

and the parameter table for the same call, :1232:

| name | str | Tool name as registered in the tool registry (e.g. "delegate_task", "file_edit") |

There is no file_edit tool. Asking the registry directly:

$ .venv/bin/python -c "
from tools.registry import discover_builtin_tools, registry
discover_builtin_tools()
names = registry.get_all_tool_names()
print('total tools:', len(names))
print('file_edit in registry:', 'file_edit' in names)
print('write_file in registry:', 'write_file' in names)
print('patch in registry:', 'patch' in names)
print('delegate_task in registry:', 'delegate_task' in names)
print('file-ish tool names:', sorted(n for n in names if 'file' in n or 'edit' in n or n=='patch'))
"
total tools: 89
file_edit in registry: False
write_file in registry: True
patch in registry: True
delegate_task in registry: True
file-ish tool names: ['patch', 'read_file', 'search_files', 'write_file', 'xai_video_edit']

file_edit has zero occurrences anywhere in the repo outside these doc lines (the only other hits are file_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:1296 states that PluginContext.dispatch_tool() "can only call tools registered in the tool registry" — that sentence is the reason send_message is deliberately absent. An author who copies the :1232 row, 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 ("invoke terminal, read_file, or any other tool"), the :538 example (ctx.dispatch_tool("terminal", …)), :1249 (kanban_*, delegate_task, terminal, read_file), :1257 (kanban_comment) — so file_edit is the lone invented name in the section.

write_file is the substitute: it is the registered file-writing tool, and it reads naturally in "spawn a subagent via delegate_task, call write_file". (patch would have worked too; write_file is 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 open returns nothing, and the dispatch_tool / plugins dispatch tool searches return only code PRs (the most recent, #109632 and #109441, change hook execution, not this page).

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 🔒 Security fix
  • 📝 Documentation update
  • ✅ Tests (adding or improving test coverage)
  • ♻️ Refactor (no behavior change)
  • 🎯 New skill (bundled or hub)

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:735 and :760 — the same two renames in the mirror; Chinese prose untouched, only the identifier inside the backticks changed.

The :1232 / :760 table 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 :1212 already dispatches delegate_task and needed no change.

How to Test

  1. Registry proof — run the snippet above in the project venv: file_edit is absent from all 89 registered tools; write_file, patch and delegate_task are present.

  2. No invented tool name is left in the docs:

    $ grep -rn "file_edit" website/
    website/docs/user-guide/skills/optional/autonomous-ai-agents/autonomous-ai-agents-openhands.md:132:- `ActionEvent` — agent picked a tool. Read `tool_name` (`file_editor`, …
    

    The single remaining hit is OpenHands' file_editor, correctly left alone.

  3. 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.

  4. Docs tests still pass: scripts/run_tests.sh tests/website → 38 passed, 0 failed.

Checklist

Code

Documentation & Housekeeping

  • I've updated relevant documentation — this PR is the documentation fix, including the zh-Hans mirror
  • I've updated cli-config.yaml.example if I added/changed config keys — N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — N/A
  • I've considered cross-platform impact — N/A (text only)
  • I've updated tool descriptions/schemas if I changed tool behavior — N/A (no tool changed; the docs now name one that exists)

…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>
@alt-glitch alt-glitch added type/docs Documentation improvements P3 Low — cosmetic, nice to have comp/plugins Plugin system and bundled plugins labels Sep 13, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/plugins Plugin system and bundled plugins P3 Low — cosmetic, nice to have type/docs Documentation improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants