docs(plugins): fold middleware, API-hook, and allow_tool_override coverage into the canonical author guide - #58538
Conversation
teknium1
left a comment
There was a problem hiding this comment.
Thanks for consolidating the plugin surface; the middleware material covers a real current API (hermes_cli/middleware.py:29-34).
Problems
docs/plugins.mdis not part of the published documentation navigation. The existing author guide iswebsite/docs/developer-guide/plugins/index.md(website/sidebars.ts:740-753), and current-maingit grepfinds no reference todocs/plugins.md. This would create a parallel, undiscoverable guide while duplicating material already present in the canonical guide (website/docs/developer-guide/plugins/index.md:8-36).
Suggested changes
- Salvage the unique middleware, API-hook, and
allow_tool_overridecoverage intowebsite/docs/developer-guide/plugins/index.mdand the hooks reference as appropriate, then revalidate retained contracts against current main.
Automated hermes-sweeper review.
| @@ -0,0 +1,633 @@ | |||
| # Hermes Plugin Author Guide | |||
There was a problem hiding this comment.
Please move the unique material into the published plugin guide instead of adding this standalone file. website/sidebars.ts:740-753 exposes website/docs/developer-guide/plugins/index.md, while current-main git grep finds no incoming reference to docs/plugins.md; this guide would not be discoverable from the documentation site.
ea3b0a5 to
26bf4f1
Compare
|
Reworked in 26bf4f1ce exactly along the suggested salvage line. docs/plugins.md is deleted; the unique middleware, per-API-call hook, and allow_tool_override coverage now lives in website/docs/developer-guide/plugins/index.md, inserted into the existing structure rather than restructuring it. Every migrated claim was re-verified against current main with file:line citations in the PR description, and the pass also fixed pre-existing guide text that implied override=True alone suffices for non-bundled plugins. Material that duplicated the canonical guide or the hooks reference was dropped rather than moved, including coverage of a hook that is not in VALID_HOOKS on main. |
The plugin system's authoring contract currently lives only in code comments (VALID_HOOKS block, PluginContext docstrings, middleware.py). With the plugin-interface expansion underway, third-party authors need a single reference. This adds docs/plugins.md covering: - Quick start (manifest + register(ctx), enable, verify) - All four discovery sources, name-collision precedence, path-derived keys - plugin.yaml field reference and the five plugin kinds with their kind/source-aware loading rules (auto-load, deferred platform, opt-in) - plugins.enabled/disabled/entries config semantics - Full PluginContext surface: tools (incl. the allow_tool_override trust gate), slash + CLI commands, all 23 hooks with per-hook return contracts, the 4 middleware kinds with chaining/next_call semantics, backend provider registries and their config selectors, platforms, Slack actions, auxiliary tasks, skills, ctx.llm/inject_message/ dispatch_tool/profile_name - State & concurrency (plugins/plugin_utils primitives) - Distribution via `hermes plugins install` (all URL forms, after-install.md, manifest_version) - Debugging (HERMES_PLUGINS_DEBUG) and common gotchas - "Converting a waiting PR into a plugin" mapping table Every claim was cross-checked against hermes_cli/plugins.py, hermes_cli/middleware.py, tools/registry.py, and shipped plugins (spotify, google_meet, disk-cleanup); hook/middleware/method names in the doc are verified to exist by script. The classify_api_error entry is marked pending PR NousResearch#58524. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FWMcB7RPSYUpsXDfBgwjzM
…aces Per maintainer feedback on the interface-ideas thread: a context-engine plugin already owns the full compression policy (should_compress / compress / preflight on the ContextEngine ABC), and a ProviderProfile already owns its model catalog (models_url / fetch_models / fallback_models). Call both out explicitly — the queued PRs that patch core for these (NousResearch#58418, NousResearch#58444, NousResearch#58453) suggest contributors don't find the existing surface, which is the failure mode this guide exists to fix. Also adds both rows to the PR-shape → seam mapping table. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FWMcB7RPSYUpsXDfBgwjzM
Per review, docs/plugins.md was a parallel guide outside the published navigation. Its genuinely unique material moves into website/docs/developer-guide/plugins/index.md: the middleware registration surface (all four VALID_MIDDLEWARE kinds with contracts and chaining rules), the per-API-call request hooks, and the allow_tool_override operator grant (which also fixes pre-existing text implying override=True alone suffices for non-bundled plugins). Every migrated claim was re-verified against current main; stale material (deep-copy claim, approval-surface coverage, a hook that is not in VALID_HOOKS on main) was corrected or dropped rather than copied. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PnMCvi2vXqfs996AjVeF2F
26bf4f1 to
3f952fc
Compare
|
Guide content landed in #82012, closing. |
What
Reworked per the sweeper review: instead of adding a parallel guide outside the published navigation, this PR now folds the genuinely unique material from the original docs/plugins.md into the canonical author guide, website/docs/developer-guide/plugins/index.md, and deletes the parallel file.
What moved (71 added lines, each claim re-verified against current main):
Deliberately not migrated: everything duplicating the canonical guide or the hooks reference, coverage of a hook not present in VALID_HOOKS on main, and a stale deep-copy claim (softened to match _safe_copy's shallow fallback, hermes_cli/middleware.py:58-74).
Testing
Docs-only change. git diff --check clean, internal anchors resolve, no duplicate headings; all cited file:line references verified on the rebased branch (current main).
Platforms tested
Not applicable (documentation).
🤖 Generated with Claude Code
https://claude.ai/code/session_01PnMCvi2vXqfs996AjVeF2F