Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions plugins/memory/honcho/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,10 @@ def get_honcho_client(config: HonchoClientConfig | None = None) -> Honcho:
}
if resolved_base_url:
kwargs["base_url"] = resolved_base_url
if _is_local:
# Local workstation models can take well over 60s for dialectic calls.
# Use a longer SDK timeout so Hermes doesn't give up before Honcho responds.
kwargs["timeout"] = 300.0

_honcho_client = Honcho(**kwargs)

Expand Down
25 changes: 25 additions & 0 deletions tests/honcho_plugin/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,31 @@ def test_absent_everywhere_defaults_false(self, tmp_path):
assert cfg.init_on_session_start is False


class TestGetHonchoClient:
def test_local_base_url_uses_longer_timeout(self):
import plugins.memory.honcho.client as mod

reset_honcho_client()
config = HonchoClientConfig(
workspace_id="local-ws",
base_url="http://127.0.0.1:8000",
enabled=True,
raw={},
)

with patch("honcho.Honcho") as mock_honcho:
mock_client = MagicMock()
mock_honcho.return_value = mock_client

result = get_honcho_client(config)

assert result is mock_client
_, kwargs = mock_honcho.call_args
assert kwargs["base_url"] == "http://127.0.0.1:8000"
assert kwargs["api_key"] == "local"
assert kwargs["timeout"] == 300.0


class TestResetHonchoClient:
def test_reset_clears_singleton(self):
import plugins.memory.honcho.client as mod
Expand Down
Loading