fix(hermes-plugin): always advertise tool schemas so they are routable before initialize() - #898
Open
francialisomlimoeiro wants to merge 1 commit into
Conversation
…e before initialize() MemoryManager.add_provider() indexes get_tool_schemas() into the tool-routing table BEFORE initialize() runs. The previous gateway-availability gate made get_tool_schemas() return [] whenever the Gateway was not yet reachable and no Gateway env var was set, so the routing table stayed empty forever and every tool call failed with "Unknown tool: memory_tencentdb_*" — even after initialize() succeeded. The schemas are static; Gateway health is already enforced at call time (handle_tool_call / _ensure_alive_for_request), so always advertise both tools instead of hiding them. Also align the auto-recall MEMORY_TOOLS_GUIDE and truncation suffix with the tool names the plugin actually registers, and update the README troubleshooting entry. Adds tests/test_tool_schema_routing.py: schemas advertised while uninitialized and without Gateway env, advertised names dispatchable, unknown names still rejected (4 tests, mock client — no Gateway).
Collaborator
|
Thanks for your contribution and attention! We will review this PR and get back to you as soon as possible. |
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 it does
MemoryManager.add_provider()indexesget_tool_schemas()into the tool-routing table BEFOREinitialize(). The old gateway-availability gate returned[]when the Gateway was not yet reachable and no Gateway env var was set, so the routing table stayed empty forever and every tool call failed withUnknown tool: memory_tencentdb_*— even afterinitialize()succeeded.Changes:
get_tool_schemas()always returns both static schemas; Gateway health is enforced at call time (handle_tool_call/_ensure_alive_for_request).src/core/hooks/auto-recall.ts: MEMORY_TOOLS_GUIDE + truncation suffix now reference the tool names the plugin actually registers (removes legacytdai_*names from advertised guidance).tests/test_tool_schema_routing.py(4 tests).Tests
(schemas advertised while uninitialized and without Gateway env; advertised names dispatchable via stub client; unknown names rejected)