fix(honcho): respect dot-form host api keys - #37456
westkite1201 wants to merge 5 commits into
Conversation
tonydwb
left a comment
There was a problem hiding this comment.
Code Review Summary
Verdict: Approved
Fix for Honcho dot-form host API key resolution. The old code used config.raw.get("hosts", {}).get(config.host, {}) which didn't properly resolve dot-form host keys. Refactored to use a proper _host_block() helper. Includes a test for local dot-form profile host with configured API key.
Reviewed by Hermes Agent
…ocal-api-key # Conflicts: # plugins/memory/honcho/client.py
|
Updated this branch with the latest main and resolved the Honcho client conflict against the current SingletonSlot-based client construction. The original fix is preserved by using _host_block(...) for local-auth host lookup, so legacy dot-form host keys are still honored.\n\nLocal checks run:\n- |
|
Confirming this bug in production — same root cause, same fix. Setup: 2-profile self-hosted Honcho deployment (Docker, Config: {"hosts": {"hermes": {...}, "hermes.ayumi": {"apiKey": "<JWT>", "aiPeer": "ayumi"}}}Impact:
Verification of this PR's fix: Applied the same The fix is correct and minimal. Would be great to see this merged — it's been open since June 2 and has already caused silent data loss in at least two independent deployments (see also #36098 Issue 2). |
|
This PR still looks mergeable and has a production confirmation above. The latest head does not appear to have GitHub Actions checks attached yet. Could a maintainer approve or re-run the workflow when convenient? |
|
Thanks for the focused regression fix. Current The changed call to Automated hermes-sweeper review. |
|
Closing this PR because the requested behavior is now implemented on main, rather than because the report was invalid. Verified at
There is no remaining unique production fix to land from this branch. Thanks to everyone who supplied production confirmation and reviewed the original fix. Updated with Hermes Agent · default profile · Telegram. |
What does this PR do?
Fixes local Honcho client initialization for legacy dot-form profile host blocks.
When the active host is the safe profile name
hermes_profile_a,HonchoClientConfig.from_global_config()already resolves legacy config blocks such ashosts.hermes.profile_aand loads the configuredapiKey. However, the local-base-url branch inget_honcho_client()re-checked host config with a directhosts[config.host]lookup, so it missed the same legacy dot-form block and replaced the configured key with the SDK placeholderlocal.This reuses the existing
_host_block()resolver in that final local-auth check, keeping behavior consistent with config loading while preserving the no-auth local fallback when no host-levelapiKeyexists.Related Issue
Fixes #37436
Type of Change
Changes Made
plugins/memory/honcho/client.py_host_block(config.raw, config.host)when deciding whether a local Honcho base URL should pass the configured hostapiKeyor thelocalplaceholder.tests/honcho_plugin/test_client.pyhermes_profile_aresolving a legacyhosts.hermes.profile_a.apiKeyblock and passing that key to the Honcho SDK for a localhost base URL.How to Test
api_keyislocalinstead ofjwt-for-local-honcho./home/seo/.hermes/hermes-agent/venv/bin/python -m pytest tests/honcho_plugin/test_client.py::TestGetHonchoClient::test_local_dot_form_profile_host_uses_configured_api_key -q -o 'addopts='/home/seo/.hermes/hermes-agent/venv/bin/python -m pytest tests/honcho_plugin/test_client.py tests/test_honcho_client_config.py -q -o 'addopts=' /home/seo/.hermes/hermes-agent/venv/bin/python -m ruff check plugins/memory/honcho/client.py tests/honcho_plugin/test_client.py tests/test_honcho_client_config.py /home/seo/.hermes/hermes-agent/venv/bin/python -m py_compile plugins/memory/honcho/client.py tests/honcho_plugin/test_client.pyChecklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/AScreenshots / Logs
Focused regression test passed:
Related Honcho tests passed:
Ruff passed:
Compile check passed: