Skip to content

fix(honcho): sanitize workspace/peer IDs to strip dots and special characters (#30246) - #30291

Closed
kagura-agent wants to merge 2 commits into
NousResearch:mainfrom
kagura-agent:fix/honcho-sanitize-dot-ids
Closed

fix(honcho): sanitize workspace/peer IDs to strip dots and special characters (#30246)#30291
kagura-agent wants to merge 2 commits into
NousResearch:mainfrom
kagura-agent:fix/honcho-sanitize-dot-ids

Conversation

@kagura-agent

Copy link
Copy Markdown
Contributor

Summary

Fixes #30246 — Honcho memory plugin generates invalid workspace/peer IDs for profile names containing dots.

Problem

resolve_active_host() produces host keys like hermes.asher for non-default profiles. These are used as workspace_id and ai_peer in HonchoClientConfig, but Honcho validates IDs with ^[a-zA-Z0-9_-]+$ — dots are rejected, causing session registration failures even when the Honcho backend is healthy and reachable.

Fix

Add _sanitize_honcho_id() helper that replaces characters outside [a-zA-Z0-9_-] with hyphens (hermes.asherhermes-asher). Applied to workspace_id and ai_peer in both from_global_config() and from_env().

The sanitization pattern matches the existing _sanitize_id() in session.py (which already handles session/peer IDs at the session level) — this fix closes the gap for workspace and AI peer IDs at the config level.

Testing

  • 10 new tests in test_honcho_client_config.py:
    • 7 unit tests for _sanitize_honcho_id() (dots, colons, valid passthrough, edge cases)
    • 3 integration tests verifying from_global_config() and from_env() produce sanitized IDs
  • All 17 tests pass locally

…aracters (NousResearch#30246)

Honcho validates IDs with ^[a-zA-Z0-9_-]+$ but profile-derived
identifiers can contain dots (e.g. hermes.asher), causing session
registration failures.

Add _sanitize_honcho_id() to replace non-alphanumeric characters
with hyphens (hermes.asher -> hermes-asher), applied to workspace_id
and ai_peer in both from_global_config() and from_env().

Adds 10 regression tests covering sanitization and config integration.
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/plugins Plugin system and bundled plugins tool/memory Memory tool and memory providers labels May 22, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Duplicate of #26478 (which fixes #26459). Both sanitize dot-separated profile host keys in Honcho workspace/peer IDs. Prior attempts: #26750 (closed), #5878 (closed).

@kagura-agent

Copy link
Copy Markdown
Contributor Author

Thanks @alt-glitch — closing in favor of #26478 which addresses the same root cause. Apologies for the duplicate!

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 tool/memory Memory tool and memory providers type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Honcho memory plugin generates invalid workspace/peer IDs for profile names containing dots

2 participants