fix(honcho): restore end-to-end chat tool behavior#4752
Open
acsezen wants to merge 3 commits into
Open
Conversation
bb32aa5 to
32d248e
Compare
32d248e to
acf88da
Compare
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.
0956569 to
409f164
Compare
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes several Hermes-side Honcho integration bugs that made a correctly configured Honcho backend look broken in normal chat sessions.
Fixes
_invoke_tool()so memory-provider tools are actually dispatchedresolve_session_name()for CLI session keys instead of raw Hermes session IDsplatform:user_idsession keys for gateway/user-scoped sessionssync_turn()to useget_or_create(...)instead of a nonexistentget_or_create_session(...)honcho_profilefall back frompeer_card->peer.get_card()->peer.conclusions.list()Why this matters
Before this patch, users could see:
Unknown tool: honcho_profile/honcho_concludein normal chatNo profile facts available yet.even when Honcho had rich stored user factsValidation
Targeted regression suite:
tests/honcho_plugin/test_provider.pytests/honcho_plugin/test_async_memory.pytests/test_run_agent.pyRun:
/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 passedRegression coverage added
resolve_session_name()for CLI sessionsplatform:user_idget_peer_card()falls back to peer-level cardget_peer_card()falls back to conclusions_invoke_tool()Closes #4751