Conversation
…ousResearch#59469) The honcho_reasoning tool path was inheriting the auto-injection dialecticMaxChars (default 600) cap. When the model explicitly asked Honcho for a synthesized answer, the result was silently cut mid-word with a trailing " …" — the system-prompt injection budget had no business clipping an explicit tool result. Fix: * dialectic_query() gains apply_injection_cap: bool = True. The auto- injection path (_run_dialectic_depth → dialectic_query) keeps the default cap; honcho_reasoning passes False. * When the cap IS applied and truncation occurs, the result now ends with " … [truncated, full result in logs]" instead of a bare ellipsis, and a WARN log names the original length and cap so the operator can tune the budget or fix the over-long prompt. The full pre-truncation text is also emitted at DEBUG level. Backward compatible: default kwarg preserves the existing auto- injection behavior; the only caller-visible change is the more explicit truncation marker and the warning log. Tests in tests/plugins/test_honcho_truncation.py cover: short result pass-through, long result truncated with marker, long result preserved when cap is off, WARN logged with original length, no false-positive WARNs on short results or when cap is disabled, default kwarg preserves existing behavior. Fixes NousResearch#59469 AI-assisted fix by https://github.com/SquabbyZ/peaks-loop Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Duplicate of #59471 — same mechanism ( |
teknium1
left a comment
There was a problem hiding this comment.
Thanks for the focused fix. The underlying premise is live on current main: plugins/memory/honcho/session.py:658-660 applies dialecticMaxChars to all dialectic queries, while plugins/memory/honcho/__init__.py:1358-1362 sends explicit honcho_reasoning through that method.
Problems
- In
plugins/memory/honcho/session.py:683, the code slices up tocapand then appends… [truncated, full result in logs]. That can exceed the configured injection budget, whose documented contract is a maximum atwebsite/docs/user-guide/features/honcho.md:124. tests/plugins/test_honcho_truncation.pytests manager calls directly, but does not prove the tool handler suppliesapply_injection_cap=False. The existing handler-level assertion istests/honcho_plugin/test_session.py:488-506.
Suggested changes
- Reserve suffix space before slicing, or retain the compact existing suffix, and assert the capped result remains within the configured budget.
- Extend the existing
honcho_reasoningdispatch test to assertapply_injection_cap=False.
Automated hermes-sweeper review.
| original_full = result | ||
| truncated_len = len(result) | ||
| cap = self._dialectic_max_chars | ||
| result = result[:cap].rsplit(" ", 1)[0] + ( |
There was a problem hiding this comment.
dialecticMaxChars is documented as the maximum injected result length, but this slices to cap and then appends a much longer marker. Please reserve suffix capacity before slicing (and add a cap-boundary assertion) so the auto-injection guardrail remains bounded.
|
This is now fixed on main via #62290 (commit 8d1c96f), which adopted the earliest submission for #59469 (#59471 by @vizi0uz). dialecticMaxChars is now scoped to automatic context injection, so explicit honcho_reasoning results return Honcho's full answer rather than being truncated at all. Thanks for the fix, sorry it collided with an earlier duplicate. |
Fixes #59469
Problem
honcho_reasoningtool results longer thandialecticMaxChars(default 600) were silently truncated to the auto-injection budget. The model deliberately asked Honcho for a full synthesized answer but the response came back clipped mid-word with a trailing " …" and no warning — the system-prompt injection guardrail was wrongly applied to an explicit tool result.Fix
dialectic_query()inplugins/memory/honcho/session.pynow acceptsapply_injection_cap: bool = True:_run_dialectic_depth→dialectic_query) keeps the defaultTrueso the per-turn system-prompt supplement is still bounded — this is the path the cap was originally designed for.honcho_reasoningtool handler inplugins/memory/honcho/__init__.pypassesapply_injection_cap=Falseso an explicit call returns Honcho's full synthesized answer untouched.When the cap is applied and truncation occurs, the result now ends with
… [truncated, full result in logs]instead of a bare ellipsis, and a WARN log names the original length and cap so operators can tune the budget or fix the over-long prompt. The full pre-truncation text is also emitted at DEBUG level. No more silent failure.Backward compatible: the default kwarg preserves the existing auto-injection behavior, so the only caller-visible changes are the more explicit truncation marker and the warning log.
Tests
tests/plugins/test_honcho_truncation.py— 7 tests, all passing:apply_injection_cap=Truepreserves prior auto-injection behavior.Existing honcho tests (22 passed, 1 skipped, no regressions) confirm the default-path semantics are unchanged.
Files
plugins/memory/honcho/session.py—dialectic_query()signature + truncation logicplugins/memory/honcho/__init__.py—honcho_reasoninghandler passesapply_injection_cap=Falsetests/plugins/test_honcho_truncation.py— new test fileAI-assisted fix by https://github.com/SquabbyZ/peaks-loop