Skip to content

Honcho view fails (422 UnprocessableEntityError) when honcho.json aiPeer contains a space — peer IDs not slugged #35

Done

Description

@atvarady

Bug Description

The Honcho memory view of the plugin fails with an HTTP 422 (UnprocessableEntityError) whenever the configured Honcho AI peer name contains a character outside [a-zA-Z0-9_-] — in our case a space (aiPeer: "RU Risk" in honcho.json).

The main honcho plugin slugs peer IDs before calling the Honcho API (re.sub(r'[^a-zA-Z0-9_-]+', '-', ...)), so the real server-side peer is RU-Risk. hermes-memory-ui passes the raw, unslogued name (RU Risk) to the Honcho SDK, and the server's peer endpoint rejects it:

UnprocessableEntityError
[{'type': 'string_pattern_mismatch', 'loc': ['body', 'id'],
  'msg': "String should match pattern '^[a-zA-Z0-9_-]+$'",
  'input': 'RU Risk'}]

Because the plugin surfaces the raised exception into base["error"], the whole Honcho panel shows an error and stays empty, even though the Honcho data itself is fine and the main honcho plugin works with the same identity.

Steps to Reproduce

  1. Configure a profile with honcho.json containing an aiPeer value containing a space, e.g. "RU Risk" (a display-style name with a space).
  2. Open the plugin's Honcho memory view (or call GET /api/plugins/hermes-memory-ui/honcho).
  3. The view errors out; the underlying Honcho data is unreachable from the dashboard.

Expected Behavior

Peer IDs taken from honcho.json should be slugged to the API-safe form (the same way the main honcho plugin does it) before being passed to the Honcho SDK, so the view resolves the actual server-side peer (RU Risk → RU-Risk).

Actual Behavior

_honcho_payload() passes the raw display name through, and client.peer("RU Risk") raises a 422 from the Honcho server; the whole panel reports an error.

Environment

  • OS: Windows 11
  • Plugin version/commit: 0.6.4 (sha 8f79810)
  • Python: 3.14
  • Interface: Hermes Desktop (gateway-mounted plugin API)
  • Honcho: cloud (https://api.honcho.dev)

Suggested Fix

In dashboard/plugin_api.py, _honcho_payload() (~line 1113), slug the IDs resolved from the config before constructing the SDK peers:

def _slug_peer(name: Any) -> str:
    """Mirror the main honcho plugin: peer IDs must match ^[a-zA-Z0-9_-]+$."""
    return re.sub(r"[^a-zA-Z0-9_-]+", "-", str(name)).strip("-") or "user"

client = get_honcho_client(cfg)
user_peer_id = _slug_peer(honcho_cfg["user_peer"] or "user")
ai_peer_id = _slug_peer(honcho_cfg["ai_peer"] or honcho_cfg["host"] or "hermes")

This is a local patch I applied and verified — after it, the Honcho view loads with no error (error: None) and correctly resolves the display name RU Risk to the existing server-side peer RU-Risk (peer cards, representations, and conclusions all populate).

Activity

  1. xraysight commented on Nov 28, 2026

    @xraysight
    Owner

    Thanks for the clear report and for testing a local fix, @atvarady ! The fix is in #36 and shipped in v0.7.2.

    The UI now follows Honcho’s own peer ID rules, so RU Risk resolves to your existing RU-Risk peer. No changes to honcho.json are needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions