feat(plugins): expose API server route extensions - #38548
Closed
sasan1200 wants to merge 1 commit into
Closed
Conversation
This was referenced Jul 30, 2026
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?
Adds a narrow plugin extension surface for the API server:
PluginContext.register_api_server_route(...)PluginContext.register_api_server_capability(...)PluginManager.get_api_server_routes()PluginManager.get_api_server_capabilities(...)This lets plugins contribute explicit API-server routes and capability metadata without importing plugin-specific code into
gateway/platforms/api_server.py. Routes are mounted after core routes and duplicate method/path registrations are skipped, so plugins cannot shadow built-in API routes.Value/drift result: this was split out from broader local plugin work because current
upstream/mainhas no API-server route/capability extension point, while the plugin release audit needs this host surface for real HTTP integration.Duplicate search result: searched upstream PRs/issues for plugin API server route/capability extension work. No focused duplicate found; the closest result was a broad hook-registry PR, not a targeted API-server route/capability surface.
Conflict notes: rebased cleanly onto
upstream/mainat1927ff217. While refreshing, preserved current upstream auxiliary-task plugin manager state and added duplicate-route coverage.Related Issue
N/A
Type of Change
Changes Made
hermes_cli/plugins.py: add API-server route and capability provider registration APIs.gateway/platforms/api_server.py: mount plugin routes after native routes and merge plugin capability metadata into/v1/capabilities.tests/hermes_cli/test_plugins.py: cover route/capability registration and provider failure isolation.tests/gateway/test_api_server.py: cover capability extension metadata, plugin route mounting, invalid route isolation, and duplicate core-route protection.How to Test
PYTHONPATH="/private/tmp/hermes-agent-upstream-main" /Volumes/MIRZA/.hermes/hermes-agent/.venv/bin/python -m pytest tests/hermes_cli/test_plugins.py tests/gateway/test_api_server.py tests/gateway/test_api_server_runs.py -q -p no:xdist -o addopts= -k "api_server or capabilities or plugin"259 passed, 131 warnings in 18.16s/Volumes/MIRZA/.hermes/hermes-agent/.venv/bin/ruff check .All checks passed!Checklist
Code
pytest tests/ -qand all tests passDocumentation & Housekeeping
cli-config.yaml.exampleif I added/changed config keys — N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — N/AScreenshots / Logs
Focused tests and ruff output are listed above. Full repository pytest was not run to completion in this local venv because unrelated collection/runtime environment issues were present (
acpextra missing, protected temp-path writes, and leaked local Anthropic auth state).