Skip to content

fix(honcho): sequential chat dispatch, session key strategy, and peer-card fallback break end-to-end Honcho UX #4751

@acsezen

Description

@acsezen

Summary

Honcho was configured correctly, but several Hermes-side integration bugs made end-to-end Honcho behavior appear broken in normal chat sessions.

I validated this against a working Honcho backend with successful connection/auth and cross-session persistence. The failures were in Hermes integration code, not user onboarding.

Symptoms

  1. honcho_profile, honcho_search, honcho_context, and honcho_conclude could appear as Unknown tool in normal chat sessions.
  2. CLI Honcho provider sessions used transient Hermes session_id instead of Honcho's configured session naming strategy (resolve_session_name()), fragmenting session history.
  3. honcho_profile returned No profile facts available yet. even when Honcho had rich user facts stored as conclusions.
  4. sync_turn() referenced a nonexistent manager method (get_or_create_session) instead of get_or_create.

Root causes

1) Sequential chat execution bypassed memory-provider dispatch

The sequential tool execution path in run_agent.py called handle_function_call(...) directly instead of self._invoke_tool(...), so memory-provider tools never reached self._memory_manager.

2) Honcho provider ignored configured session strategy for CLI sessions

HonchoMemoryProvider.initialize() used the raw Hermes session_id for CLI sessions instead of HonchoClientConfig.resolve_session_name(...).

3) Honcho session cache was not guaranteed to be primed before first tool use

Honcho tool handlers rely on the session manager cache, but first-turn tool usage could happen before the backing Honcho session had been cached.

4) honcho_profile only consulted peer_card

Some Honcho deployments store useful profile facts primarily in peer conclusions / representations. Hermes treated empty peer_card as no data.

Fix implemented locally

  • Route sequential chat tool execution through _invoke_tool().
  • In Honcho provider initialize:
    • use resolve_session_name(cwd=os.getcwd(), session_id=session_id) for CLI sessions
    • keep platform:user_id for gateway/user-scoped sessions
    • prime the Honcho session cache immediately
  • In Honcho tool dispatch:
    • ensure get_or_create(self._session_key) runs before serving any tool
  • In sync_turn():
    • replace get_or_create_session(...) with get_or_create(...)
  • In get_peer_card():
    • try session peer_card
    • then peer-level get_card()
    • then fall back to peer.conclusions.list()

Validation

Confirmed working after the fixes:

  • honcho_profile
  • honcho_search
  • honcho_context
  • honcho_conclude
  • cross-session retrieval of a unique validation marker from a fresh session/process
  • CLI session naming now matches configured Honcho strategy

Regression tests added locally

  • provider initialization uses resolve_session_name() for CLI sessions
  • gateway/user-scoped sessions still use platform:user_id
  • Honcho tool dispatch primes session cache
  • get_peer_card() falls back to peer-level card
  • get_peer_card() falls back to conclusions
  • sequential run-agent path uses _invoke_tool()

Notes

This is not a user-onboarding issue. Honcho itself was healthy and Hermes-side fixes resolved the behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low — cosmetic, nice to havecomp/agentCore agent loop, run_agent.py, prompt buildercomp/pluginsPlugin system and bundled pluginstype/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