fix(plugins/honcho): strip version prefix from base_url for self-hosted instances (#20688)#20720
Closed
Beandon13 wants to merge 1 commit into
Closed
Conversation
…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>
1 task
This was referenced May 26, 2026
Contributor
|
This appears to be implemented on current main by a broader Honcho self-hosting hardening commit. Automated hermes-sweeper review evidence:
Closing this PR as already implemented on main. Thank you for the original focused fix and regression-test direction. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug
When using a self-hosted Honcho instance with
base_url = "http://localhost:38000/v3", the Honcho SDK double-prefixes the API version: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) fromresolved_base_urlbefore passing it to theHonchoconstructor, only for local instances (localhost, 127.0.0.1, ::1). Cloud base URLs are not modified.The SDK then appends its own versioned routes (
/v3/workspaces, etc.) correctly.Tests
Added
TestGetHonchoClientBaseUrlDoublePrefixFixintests/honcho_plugin/test_client.pywith 4 cases:/v3http://localhost:38000/v3http://localhost:38000http://localhost:38000http://localhost:38000https://api.honcho.dev/v3https://api.honcho.dev/v3(unchanged)/v3/trailing slashhttp://127.0.0.1:38000/v3/http://127.0.0.1:38000Closes #20688