Skip to content

fix(honcho): skip dialectic char cap for explicit honcho_reasoning tool calls - #59495

Closed
LavyaTandel wants to merge 2 commits into
NousResearch:mainfrom
LavyaTandel:fix/honcho-dialectic-truncation-cap
Closed

LavyaTandel wants to merge 2 commits into
NousResearch:mainfrom
LavyaTandel:fix/honcho-dialectic-truncation-cap

Conversation

@LavyaTandel

Copy link
Copy Markdown

What

Skip the dialecticMaxChars truncation cap when honcho_reasoning is called explicitly by the model. Previously, tool results were silently clipped to 600 chars mid-word even when the model spent a turn requesting a full synthesized answer.

Why

dialectic_query() shared one truncation path for two call sites:

  1. Auto-injection (system prompt supplement) — tight cap correct
  2. honcho_reasoning tool — model explicitly requested a full answer, no reason to clip

The server returns untruncated results; the clip is purely client-side.

Fix

Add apply_injection_cap: bool = True parameter to dialectic_query(). The honcho_reasoning tool handler passes False. Auto-injection path unchanged (default True).

Files changed:

  • plugins/memory/honcho/session.py: new parameter + guard on truncation
  • plugins/memory/honcho/__init__.py: tool handler passes apply_injection_cap=False

Runtime Proof

Before: honcho_reasoning result truncated at 600 chars with trailing …
After: full server response returned, no truncation

Duplicate Scan

No existing PRs for #59469.

Closes #59469

@alt-glitch alt-glitch added type/bug Something isn't working comp/plugins Plugin system and bundled plugins tool/memory Memory tool and memory providers P3 Low — cosmetic, nice to have duplicate This issue or pull request already exists labels Jul 6, 2026
@alt-glitch

Copy link
Copy Markdown
Contributor

This was generated by AI during triage.

Duplicate of #59471 (earlier, same fix). Both add apply_injection_cap to dialectic_query() in plugins/memory/honcho/session.py and pass apply_injection_cap=False from the honcho_reasoning tool handler — same mechanism, same code sites. #59471 was opened first, so it's canonical.

…ol calls

What: honcho_reasoning tool results were silently truncated to
dialecticMaxChars (default 600) mid-word, even when the model
explicitly requested a full synthesized answer. No error surfaced.

Why: dialectic_query() shared one truncation path for two call sites:
auto-injection (correct — small cap for always-on system prompt
supplement) and the honcho_reasoning tool (incorrect — model spent a
turn requesting a full answer, no reason to clip).

Fix: Add apply_injection_cap parameter (default True for backward
compat). honcho_reasoning tool handler passes False so explicit user
queries get the full server response. Auto-injection path unchanged.

Closes NousResearch#59469
@LavyaTandel
LavyaTandel force-pushed the fix/honcho-dialectic-truncation-cap branch from b2611c7 to 0662093 Compare July 6, 2026 09:21

@teknium1 teknium1 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for isolating the explicit-tool path from the auto-injection path. Current main still has the shared unconditional cap at plugins/memory/honcho/session.py:658-660, and honcho_reasoning reaches it through plugins/memory/honcho/__init__.py:1358-1362.

Problems

  • tests/honcho_plugin/test_session.py:501-506 asserts the exact dialectic_query() call without apply_injection_cap; this PR adds that keyword at plugins/memory/honcho/__init__.py:1362, so the existing test will fail as written.
  • The diff has no behavioral regression test covering an over-cap response for both the default injection path and the explicit tool path.

Suggested changes

  • Update the exact-call assertion to include apply_injection_cap=False.
  • Add a focused long-response test proving the default still caps results and the explicit-tool flag does not.

This is an automated hermes-sweeper review.

self._session_key, query,
reasoning_level=reasoning_level,
peer=peer,
apply_injection_cap=False,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update tests/honcho_plugin/test_session.py:501-506: it uses assert_called_once_with(...) for this call and currently omits this new keyword, so the existing test will fail after this change.

@teknium1 teknium1 added the sweeper:blast-contained Sweeper blast radius: contained — one narrow path / opt-in / few users label Jul 15, 2026
@teknium1

Copy link
Copy Markdown
Collaborator

This is now fixed on main via #62290 (commit 8d1c96f), which adopted the earliest submission for #59469 (#59471 by @vizi0uz, submitted ~45 min before this one). Explicit honcho_reasoning tool calls no longer get clipped to dialecticMaxChars — the cap is scoped to automatic context injection only. Thanks for the fix, sorry it collided with an earlier duplicate.

@teknium1 teknium1 closed this Jul 16, 2026
@teknium1 teknium1 added the area/memory Memory subsystem: store, providers, sync, background reviews label Jul 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/memory Memory subsystem: store, providers, sync, background reviews comp/plugins Plugin system and bundled plugins duplicate This issue or pull request already exists P3 Low — cosmetic, nice to have sweeper:blast-contained Sweeper blast radius: contained — one narrow path / opt-in / few users tool/memory Memory tool and memory providers type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: honcho_reasoning results silently truncated to dialecticMaxChars (system-prompt injection budget wrongly applied to explicit tool results)

3 participants