fix(compat): the Honcho memory plugin registers again
The catalog pin of Honcho 1.2.0 (plugin-catalog/honcho.yaml, hermes-plugin-honcho/client.py:34) imports TITLE_SOURCE_DERIVED and TITLE_SOURCE_LLM from hermes_state_common at module top level. The storage refactor turned that file into a text marker for old updaters, so the import fails and the plugin never registers. A MOVES alias cannot help, because the module still exists. hermes_state_common carries the two constants again. They are the values stored in sessions.title_source; root modules may not import the SQLite backend, so they are written out, and a test pins them to the store's. The marker text the old updaters read is unchanged.
This commit is contained in:
@@ -1,8 +1,17 @@
|
||||
"""A text marker for the update downgrade guard of v0.22.7..v0.23.1; this module holds no code.
|
||||
"""A text marker for the update downgrade guard of v0.22.7..v0.23.1, and the title constants outside plugins import.
|
||||
|
||||
Those updaters read the target tree's root ``hermes_state*.py`` for the runtime ledger table below and refuse the
|
||||
update as a downgrade when no file carries it. The session store lives in ``persistence/sqlite/``; this file keeps
|
||||
the text so a host on one of those releases can still update.
|
||||
|
||||
The Honcho memory plugin (plugin-catalog/honcho.yaml) imports the two title-provenance constants from here at module
|
||||
top level, so without them it never registers. They are the values stored in ``sessions.title_source``, so they
|
||||
cannot change without a data migration; the storage layer keeps its own copy and the code outside it may not import it.
|
||||
"""
|
||||
|
||||
TITLE_SOURCE_DERIVED = "derived"
|
||||
TITLE_SOURCE_LLM = "llm"
|
||||
|
||||
__all__ = ["TITLE_SOURCE_DERIVED", "TITLE_SOURCE_LLM"]
|
||||
|
||||
# CREATE TABLE IF NOT EXISTS session_admissions
|
||||
|
||||
@@ -10,11 +10,13 @@ from hermes_agent.compat.finder import Finder
|
||||
from hermes_agent.compat.moves import MOVES
|
||||
|
||||
# (module, names) a catalog plugin imports at module top level, so without them it never registers:
|
||||
# OpenViking 2.1.2 (plugin-catalog/openviking.yaml) and hermes-council. Every MOVES key is checked as well.
|
||||
# OpenViking 2.1.2 (plugin-catalog/openviking.yaml), hermes-council and Honcho 1.2.0 (plugin-catalog/honcho.yaml).
|
||||
# Every MOVES key is checked as well.
|
||||
_PLUGIN_IMPORTS = {
|
||||
"agent.message_content": ("flatten_message_text", "_text_from_part"),
|
||||
"agent.context_compressor_retry": ("retryable_user_text",),
|
||||
"agent.skill_commands": ("extract_user_instruction_from_skill_message", "register_auto_load_scaffold"),
|
||||
"hermes_state_common": ("TITLE_SOURCE_DERIVED", "TITLE_SOURCE_LLM"),
|
||||
}
|
||||
|
||||
|
||||
@@ -31,3 +33,12 @@ def test_old_import_paths_resolve_through_the_compat_finder(old, monkeypatch):
|
||||
assert module is importlib.import_module(MOVES[old])
|
||||
for name in _PLUGIN_IMPORTS.get(old, ()):
|
||||
assert hasattr(module, name), f"{old} has no {name!r}"
|
||||
|
||||
|
||||
def test_the_plugin_title_constants_are_the_values_the_store_writes():
|
||||
"""Honcho compares a session's stored ``title_source`` with them, so they must stay the store's values."""
|
||||
import hermes_state_common
|
||||
from persistence.sqlite._state import common as store
|
||||
|
||||
assert (hermes_state_common.TITLE_SOURCE_DERIVED, hermes_state_common.TITLE_SOURCE_LLM) == (
|
||||
store.TITLE_SOURCE_DERIVED, store.TITLE_SOURCE_LLM)
|
||||
|
||||
Reference in New Issue
Block a user