Skip to content

_host_key() returns dot-separated form ("hermes.fundraising") that violates Honcho workspace ID regex #26459

@sschahal123

Description

@sschahal123

Summary

_host_key() in plugins/memory/honcho/cli.py:238 returns f"{HOST}.{_profile_override}" when a profile override is set (e.g. hermes.fundraising for the fundraising profile). That dotted string can end up as the workspace_id sent to Honcho's API via the fallback in plugins/memory/honcho/client.py:373-378:

workspace = (
    host_block.get("workspace")
    or raw.get("workspace")
    or resolved_host         # ← falls back to _host_key() which has a dot
)

If a honcho.json host block doesn't have an explicit workspace field, the fallback returns the dot-form. Honcho's API rejects it with:

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

Why this surfaces

Running with --profile <name> produces logs like:

WARNING plugins.memory.honcho: Honcho init failed:
[{'type': 'string_pattern_mismatch',
  'loc': ['body', 'id'],
  'msg': "String should match pattern '^[a-zA-Z0-9_-]+$'",
  'input': 'hermes.<profile_name>'}]

Once per minute. The Honcho memory plugin silently disables itself but the warning floods the journal.

Reproduce

  1. Configure Hermes with a non-default profile name, e.g. myprofile.
  2. Initialize Honcho via the CLI (hermes honcho setup), but DO NOT manually set the inner workspace field in the host block.
  3. Run with --profile myprofile.
  4. Observe the warning in journal/logs.

Workaround (what we do)

Manually set honcho.jsonhosts.<host_key>.workspace to an underscore-only string (e.g. hermes_myprofile). The explicit field wins over the fallback chain.

Proposed fix

One-line change in plugins/memory/honcho/cli.py:238:

-        return f"{HOST}.{_profile_override}"
+        return f"{HOST}_{_profile_override}"

Plus a one-time migration helper for existing installs whose honcho.json outer keys are the dot-form: rename hosts."hermes.X"hosts."hermes_X". The inner workspace field is already underscore-tolerant.

Impact

Cosmetic for users who set the explicit workspace field (no functional break). Real breakage for users relying on the fallback (their Honcho integration silently disabled).

Happy to send a PR with the rename + migration helper if you'd like — let me know.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low — cosmetic, nice to havecomp/pluginsPlugin system and bundled pluginstool/memoryMemory tool and memory providerstype/bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions