mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-31 19:16:29 +00:00
feat(memory): provider actions extension point
Providers with behavior beyond fields (validate a server, start a local
instance, link a CLI profile) previously had no mount besides forking the
panel. Let the schema declare actions and one generic endpoint run them:
ProviderAction on ProviderConfigSchema, POST
/api/memory/providers/{name}/actions/{action} dispatching to
ACTION_HANDLERS in the plugin's config_actions.py (path-loaded and
import-light, like the schema), profile-scoped and off the event loop.
Handlers get the submitted values dict, return a JSON-able result, and
raise ValueError for user-facing 400s. The panel renders declared actions
as generic buttons beside Save. No bundled provider declares actions yet.
This commit is contained in:
parent
76c063b3d9
commit
35099685be
9 changed files with 259 additions and 5 deletions
|
|
@ -65,3 +65,9 @@ def test_broken_schema_is_not_cached(monkeypatch, tmp_path):
|
|||
recovered = get_provider_config_schema("broken")
|
||||
assert recovered is not None
|
||||
assert recovered.label == "Broken"
|
||||
|
||||
|
||||
def test_provider_without_action_module_has_no_handlers():
|
||||
from plugins.memory.config_schema import get_provider_action_handler
|
||||
|
||||
assert get_provider_action_handler("honcho", "anything") is None
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue