Skip to content

fix(honcho): restore end-to-end chat tool behavior#4752

Open
acsezen wants to merge 3 commits into
NousResearch:mainfrom
acsezen:fix/honcho-end-to-end-regressions
Open

fix(honcho): restore end-to-end chat tool behavior#4752
acsezen wants to merge 3 commits into
NousResearch:mainfrom
acsezen:fix/honcho-end-to-end-regressions

Conversation

@acsezen

@acsezen acsezen commented Apr 3, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR fixes several Hermes-side Honcho integration bugs that made a correctly configured Honcho backend look broken in normal chat sessions.

Fixes

  • route sequential chat tool execution through _invoke_tool() so memory-provider tools are actually dispatched
  • use Honcho resolve_session_name() for CLI session keys instead of raw Hermes session IDs
  • keep platform:user_id session keys for gateway/user-scoped sessions
  • prime the Honcho session cache before first tool use
  • fix sync_turn() to use get_or_create(...) instead of a nonexistent get_or_create_session(...)
  • make honcho_profile fall back from peer_card -> peer.get_card() -> peer.conclusions.list()

Why this matters

Before this patch, users could see:

  • Unknown tool: honcho_profile / honcho_conclude in normal chat
  • fragmented Honcho history caused by transient CLI session keys
  • No profile facts available yet. even when Honcho had rich stored user facts

Validation

Targeted regression suite:

  • tests/honcho_plugin/test_provider.py
  • tests/honcho_plugin/test_async_memory.py
  • tests/test_run_agent.py

Run:

  • /home/asezen/.hermes/hermes-agent/venv/bin/python3 -m pytest tests/honcho_plugin/test_provider.py tests/honcho_plugin/test_async_memory.py tests/test_run_agent.py -q -o 'addopts='

Result:

  • 278 passed

Regression coverage added

  • 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()

Closes #4751

@acsezen acsezen force-pushed the fix/honcho-end-to-end-regressions branch from bb32aa5 to 32d248e Compare April 3, 2026 09:54
@acsezen acsezen force-pushed the fix/honcho-end-to-end-regressions branch from 32d248e to acf88da Compare April 3, 2026 09:58
When config.yaml has no model entry (e.g. in tests), the gateway model
resolved to an empty string. The Codex provider then rejected the request
with 'model must be a non-empty string' instead of retrying after a 401
token refresh.

Now falls back to os.getenv('HERMES_MODEL') when config doesn't provide
a model, consistent with the cron scheduler path.
@acsezen acsezen force-pushed the fix/honcho-end-to-end-regressions branch from 0956569 to 409f164 Compare April 3, 2026 14:25
…ile read guard

Two pre-existing issues causing test_file_read_guards timeouts on CI:

1. agent/redact.py: _ENV_ASSIGN_RE used unbounded [A-Z_]* with
   IGNORECASE, matching any letter/underscore to end-of-string at
   each position → O(n²) backtracking on 100K+ char inputs.
   Bounded to {0,50} since env var names are never that long.

2. tools/file_tools.py: redact_sensitive_text() ran BEFORE the
   character-count guard, so oversized content (that would be rejected
   anyway) went through the expensive regex first. Reordered to check
   size limit before redaction.
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/agent Core agent loop, run_agent.py, prompt builder comp/plugins Plugin system and bundled plugins labels May 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent loop, run_agent.py, prompt builder comp/plugins Plugin system and bundled plugins P3 Low — cosmetic, nice to have type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants