Skip to content

fix(honcho): respect nested host aiPeer config in SOUL.md sync#5061

Closed
MacroAnarchy wants to merge 1 commit into
NousResearch:mainfrom
MacroAnarchy:fix/honcho-respect-configured-aipeer
Closed

fix(honcho): respect nested host aiPeer config in SOUL.md sync#5061
MacroAnarchy wants to merge 1 commit into
NousResearch:mainfrom
MacroAnarchy:fix/honcho-respect-configured-aipeer

Conversation

@MacroAnarchy

Copy link
Copy Markdown
Contributor

Bug

The SOUL.md aiPeer sync (added in #1969, landed via commit 9e0fc62) checks cfg.raw.get("aiPeer") which only reads the root-level aiPeer key from the raw config dict. But the Hermes setup wizard writes aiPeer under hosts.<host>.aiPeer (see cli.py line 736) — the canonical nested format documented in client.py.

For any user who ran hermes honcho setup AND has a SOUL.md whose first heading doesn't exactly match their configured aiPeer, the sync silently overrides the configured value with a sanitized version of the SOUL.md heading.

Concrete repro

Config (standard wizard output):

{
  "hosts": {
    "hermes": { "peerName": "Tiger", "aiPeer": "clawd" }
  }
}

SOUL.md:

# SOUL.md — Who I Am

I am Clawd. [...]

Expected: assistant peer id = clawd
Actual: assistant peer id = SOUL-md---Who-I-Am (sanitized first heading)

Result: honcho_profile, honcho_search, and auto-injected context all return empty because the session's assistant peer has no data — the user's actual conclusions/observations were written under clawd.

Fix

Also skip the sync when cfg.ai_peer was already customized from its default ("hermes"). The resolved cfg.ai_peer is set correctly from the host block at config load time in HonchoClientConfig.from_global_config() — the sync check just looked at the wrong level.

already_configured = (
    cfg.raw.get("aiPeer") is not None
    or (cfg.ai_peer and cfg.ai_peer != "hermes")
)
if hermes_home and not already_configured:
    # ... SOUL.md sync logic

Testing

  • Verified locally: with nested hosts.hermes.aiPeer: "clawd" config + SOUL.md with # SOUL.md — Who I Am heading, the sync is now correctly skipped and honcho_profile returns the 40-item peer card for clawd.
  • SOUL.md sync still runs when cfg.ai_peer == "hermes" (default), so existing behavior for users who never configured aiPeer is preserved.
  • No change to root-level aiPeer check — backward compatible with flat configs.

Users affected

Anyone who ran hermes honcho setup (always writes nested) with a SOUL.md whose heading doesn't match their configured aiPeer.

The SOUL.md aiPeer sync check 'cfg.raw.get("aiPeer")' only reads the
root-level aiPeer key from the raw config dict. But the Hermes setup
wizard writes aiPeer under 'hosts.<host>.aiPeer' (see cli.py line 736),
which is the canonical nested format documented in client.py.

For any user with a nested host config and a SOUL.md whose first heading
or YAML name doesn't exactly match their configured aiPeer, the sync
silently overrides the configured value with a sanitized version of the
SOUL.md heading (e.g. '# SOUL.md — Who I Am' becomes peer id
'SOUL-md---Who-I-Am').

The resolved cfg.ai_peer is set correctly from the host block at config
load time — the sync check just looked at the wrong level.

Fix: also skip the sync when cfg.ai_peer was already customized from its
default ('hermes'), which is true whenever the host block set it.

Users affected: anyone who ran 'hermes honcho setup' (which always writes
nested) and has a SOUL.md with a heading that doesn't match their aiPeer.
@teknium1

Copy link
Copy Markdown
Contributor

Thanks for the detailed write-up and repro, @MacroAnarchy! This is a real bug — but it was already fixed on main before this PR could be reviewed.

Automated hermes-sweeper review.

  • The SOUL.md aiPeer sync block (originally from fix(honcho): sync aiPeer with SOUL.md identity at runtime #1969) was removed entirely in commit cc6e8941d (feat(honcho): context injection overhaul, 5-tool surface, cost safety, session isolation, merged April 15 2026 — after this PR was opened April 4 2026).
  • plugins/memory/honcho/__init__.py now has an explicit comment at the former sync site: # ----- Port #1969: aiPeer sync from SOUL.md — REMOVED ----- / # SOUL.md is persona content, not identity config. aiPeer should / # only come from honcho.json (host block or root) or the default.
  • No cfg.raw.get("aiPeer") sync code exists anywhere in the current file — the root cause of the bug is gone.

The fix in this PR is correct and the analysis is accurate; the behaviour was just resolved via a broader overhaul rather than the targeted patch here. Closing as implemented on main.

@teknium1 teknium1 closed this Apr 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants