mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-25 00:51:20 +00:00
fix(honcho): plugin drift overhaul -- observation config, chunking, setup wizard, docs, dead code cleanup
Salvaged from PR #5045 by erosika. - Replace memoryMode/peer_memory_modes with granular per-peer observation config - Add message chunking for Honcho API limits (25k chars default) - Add dialectic input guard (10k chars default) - Add dialecticDynamic toggle for reasoning level auto-bump - Rewrite setup wizard with cloud/local deployment picker - Switch peer card/profile/search from session.context() to direct peer APIs - Add server-side observation sync via get_peer_configuration() - Fix base_url/baseUrl config mismatch for self-hosted setups - Fix local auth leak (cloud API keys no longer sent to local instances) - Remove dead code: memoryMode, peer_memory_modes, linkedHosts, suppress flags, SOUL.md aiPeer sync - Add post_setup hook to memory_setup.py for provider-specific setup wizards - Comprehensive README rewrite with full config reference - New optional skill: autonomous-ai-agents/honcho - Expanded memory-providers.md with multi-profile docs - 9 new tests (chunking, dialectic guard, peer lookups), 14 dead tests removed - Fix 2 pre-existing TestResolveConfigPath filesystem isolation failures
This commit is contained in:
parent
12724e6295
commit
c02c3dc723
12 changed files with 1265 additions and 443 deletions
|
|
@ -30,7 +30,6 @@ class TestHonchoClientConfigDefaults:
|
|||
assert config.session_strategy == "per-directory"
|
||||
assert config.recall_mode == "hybrid"
|
||||
assert config.session_peer_prefix is False
|
||||
assert config.linked_hosts == []
|
||||
assert config.sessions == {}
|
||||
|
||||
|
||||
|
|
@ -106,7 +105,6 @@ class TestFromGlobalConfig:
|
|||
"hermes": {
|
||||
"workspace": "override-ws",
|
||||
"aiPeer": "override-ai",
|
||||
"linkedHosts": ["cursor"],
|
||||
}
|
||||
}
|
||||
}))
|
||||
|
|
@ -116,7 +114,6 @@ class TestFromGlobalConfig:
|
|||
# Host block workspace overrides root workspace
|
||||
assert config.workspace_id == "override-ws"
|
||||
assert config.ai_peer == "override-ai"
|
||||
assert config.linked_hosts == ["cursor"]
|
||||
assert config.environment == "staging"
|
||||
assert config.peer_name == "alice"
|
||||
assert config.enabled is True
|
||||
|
|
@ -297,41 +294,6 @@ class TestResolveSessionName:
|
|||
assert result == "custom-session"
|
||||
|
||||
|
||||
class TestGetLinkedWorkspaces:
|
||||
def test_resolves_linked_hosts(self):
|
||||
config = HonchoClientConfig(
|
||||
workspace_id="hermes-ws",
|
||||
linked_hosts=["cursor", "windsurf"],
|
||||
raw={
|
||||
"hosts": {
|
||||
"cursor": {"workspace": "cursor-ws"},
|
||||
"windsurf": {"workspace": "windsurf-ws"},
|
||||
}
|
||||
},
|
||||
)
|
||||
workspaces = config.get_linked_workspaces()
|
||||
assert "cursor-ws" in workspaces
|
||||
assert "windsurf-ws" in workspaces
|
||||
|
||||
def test_excludes_own_workspace(self):
|
||||
config = HonchoClientConfig(
|
||||
workspace_id="hermes-ws",
|
||||
linked_hosts=["other"],
|
||||
raw={"hosts": {"other": {"workspace": "hermes-ws"}}},
|
||||
)
|
||||
workspaces = config.get_linked_workspaces()
|
||||
assert workspaces == []
|
||||
|
||||
def test_uses_host_key_as_fallback(self):
|
||||
config = HonchoClientConfig(
|
||||
workspace_id="hermes-ws",
|
||||
linked_hosts=["cursor"],
|
||||
raw={"hosts": {"cursor": {}}}, # no workspace field
|
||||
)
|
||||
workspaces = config.get_linked_workspaces()
|
||||
assert "cursor" in workspaces
|
||||
|
||||
|
||||
class TestResolveConfigPath:
|
||||
def test_prefers_hermes_home_when_exists(self, tmp_path):
|
||||
hermes_home = tmp_path / "hermes"
|
||||
|
|
@ -346,14 +308,22 @@ class TestResolveConfigPath:
|
|||
def test_falls_back_to_global_when_no_local(self, tmp_path):
|
||||
hermes_home = tmp_path / "hermes"
|
||||
hermes_home.mkdir()
|
||||
# No honcho.json in HERMES_HOME
|
||||
# No honcho.json in HERMES_HOME — also isolate ~/.hermes so
|
||||
# the default-profile fallback doesn't hit the real filesystem.
|
||||
fake_home = tmp_path / "fakehome"
|
||||
fake_home.mkdir()
|
||||
|
||||
with patch.dict(os.environ, {"HERMES_HOME": str(hermes_home)}):
|
||||
with patch.dict(os.environ, {"HERMES_HOME": str(hermes_home)}), \
|
||||
patch.object(Path, "home", return_value=fake_home):
|
||||
result = resolve_config_path()
|
||||
assert result == GLOBAL_CONFIG_PATH
|
||||
|
||||
def test_falls_back_to_global_without_hermes_home_env(self):
|
||||
with patch.dict(os.environ, {}, clear=False):
|
||||
def test_falls_back_to_global_without_hermes_home_env(self, tmp_path):
|
||||
fake_home = tmp_path / "fakehome"
|
||||
fake_home.mkdir()
|
||||
|
||||
with patch.dict(os.environ, {}, clear=False), \
|
||||
patch.object(Path, "home", return_value=fake_home):
|
||||
os.environ.pop("HERMES_HOME", None)
|
||||
result = resolve_config_path()
|
||||
assert result == GLOBAL_CONFIG_PATH
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue