Skip to content

fix(plugins/honcho): strip version prefix from base_url for self-hosted instances (#20688)#20720

Closed
Beandon13 wants to merge 1 commit into
NousResearch:mainfrom
Beandon13:fix/hermes-20688-honcho-base-url-double-prefix
Closed

fix(plugins/honcho): strip version prefix from base_url for self-hosted instances (#20688)#20720
Beandon13 wants to merge 1 commit into
NousResearch:mainfrom
Beandon13:fix/hermes-20688-honcho-base-url-double-prefix

Conversation

@Beandon13

Copy link
Copy Markdown
Contributor

Bug

When using a self-hosted Honcho instance with base_url = "http://localhost:38000/v3", the Honcho SDK double-prefixes the API version:

base_url + routes.workspaces() = "http://localhost:38000/v3" + "/v3/workspaces"
                                = "http://localhost:38000/v3/v3/workspaces"  ← 404!

This blocks Honcho memory functionality entirely for self-hosted users — every peer and session initialization call 404s.

Fix

In get_honcho_client() (plugins/memory/honcho/client.py), strip any trailing version path segment (/vN) from resolved_base_url before passing it to the Honcho constructor, only for local instances (localhost, 127.0.0.1, ::1). Cloud base URLs are not modified.

# Before (broken for self-hosted):
kwargs["base_url"] = "http://localhost:38000/v3"
# After (correct):
kwargs["base_url"] = "http://localhost:38000"

The SDK then appends its own versioned routes (/v3/workspaces, etc.) correctly.

Tests

Added TestGetHonchoClientBaseUrlDoublePrefixFix in tests/honcho_plugin/test_client.py with 4 cases:

Scenario Input base_url Expected passed to SDK
Local with /v3 http://localhost:38000/v3 http://localhost:38000
Local without version http://localhost:38000 http://localhost:38000
Cloud URL (not local) https://api.honcho.dev/v3 https://api.honcho.dev/v3 (unchanged)
Local with /v3/ trailing slash http://127.0.0.1:38000/v3/ http://127.0.0.1:38000
$ python3 -m pytest tests/honcho_plugin/test_client.py::TestGetHonchoClientBaseUrlDoublePrefixFix -v
PASSED ...test_local_base_url_with_v3_suffix_stripped
PASSED ...test_local_base_url_without_version_unchanged
PASSED ...test_cloud_base_url_not_modified
PASSED ...test_local_base_url_with_trailing_slash_stripped

Closes #20688

…ed instances (NousResearch#20688)

The Honcho SDK's route builders (e.g. routes.workspaces()) return paths that
already include the API version prefix (e.g. "/v3/workspaces"). When a user
configures a self-hosted instance with base_url = "http://localhost:38000/v3",
the SDK concatenates them into "/v3/v3/workspaces", causing 404 errors on every
peer and session initialization call.

Strip any trailing version path segment (/vN) from base_url before passing it
to the Honcho constructor for local instances (localhost, 127.0.0.1, ::1).
Cloud base_urls are not local and remain unchanged.

Adds four regression tests in tests/honcho_plugin/test_client.py covering:
- /v3 suffix stripped for localhost URL
- no-version URL left unchanged
- cloud URL not modified
- /v3/ with trailing slash also cleaned

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@teknium1

Copy link
Copy Markdown
Contributor

This appears to be implemented on current main by a broader Honcho self-hosting hardening commit.

Automated hermes-sweeper review evidence:

  • plugins/memory/honcho/client.py:853 documents the Honcho SDK /v3/v3 double-prefix issue and strips a trailing version segment from resolved_base_url with re.sub(r"/v\d+/*$", "", resolved_base_url).rstrip("/") before SDK initialization.
  • plugins/memory/honcho/client.py:870 then passes the cleaned value as kwargs["base_url"] to Honcho(**kwargs).
  • tests/honcho_plugin/test_client.py:921 includes regression coverage for Bug: Honcho SDK double-prefixing causes 404 errors for self-hosted instances #20688, including http://localhost:38000/v3 becoming http://localhost:38000.
  • tests/honcho_plugin/test_client.py:1073 covers the trailing slash case from this PR: http://127.0.0.1:38000/v3/ becoming http://127.0.0.1:38000.
  • The implementation landed in 827ce602dbed199f665f3975b61303aace2963ea (fix(honcho): harden self-hosted setup paths), whose commit message explicitly says it closes Bug: Honcho SDK double-prefixing causes 404 errors for self-hosted instances #20688. That commit is contained in tag v2026.6.5.

Closing this PR as already implemented on main. Thank you for the original focused fix and regression-test direction.

@teknium1 teknium1 closed this Jun 11, 2026
@teknium1 teknium1 added the sweeper:implemented-on-main Sweeper: behavior already present on current main label Jun 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/plugins Plugin system and bundled plugins P3 Low — cosmetic, nice to have sweeper:implemented-on-main Sweeper: behavior already present on current main type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Honcho SDK double-prefixing causes 404 errors for self-hosted instances

3 participants