Conversation
…tion budget dialecticMaxChars (default 600) is documented as the budget for the dialectic supplement auto-injected into the system prompt every turn — a small recurring cost that is correct to bound tightly. But dialectic_query() applied that cap unconditionally, so explicit honcho_reasoning tool calls — where the model deliberately spends a turn asking for a synthesized answer — were silently truncated mid-word to 600 chars with a trailing " …", no error surfaced. The full answer is returned by Honcho server-side; the clip happens client-side. The auto-injection path already has its own token-based budget (contextTokens, enforced in prefetch() via _truncate_to_budget), so the char cap's real job is a cheap always-on guardrail for that recurring injection. Explicit tool results are already bounded server-side by Honcho's dialectic MAX_OUTPUT_TOKENS and don't need the injection cap — sibling tools (honcho_search, honcho_context) don't post-clip their results either. Add apply_injection_cap (default True, preserving current behavior) to dialectic_query(); the honcho_reasoning tool handler passes False so it returns Honcho's full synthesized answer. Auto-injection is unchanged. Tests cover both the capped injection path and the uncapped tool path. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Thanks for the focused regression fix. The premise is live on current The proposed defaulted The PR base is an ancestor of current Automated hermes-sweeper review. |
What does this PR do?
honcho_reasoningtool results longer thandialecticMaxChars(default 600) were silentlytruncated mid-word with a trailing
" …", even though the model deliberately spent a turn askingHoncho for a full synthesized answer. This scopes that char cap to the auto-injection path it was
designed for, so explicit tool calls return Honcho's complete answer.
dialecticMaxCharsis documented as the budget for the dialectic supplement auto-injected into thesystem prompt every turn — a small always-on guardrail. But
HonchoSessionManager.dialectic_query()applied it unconditionally, and that one method is shared by both the auto-injection path
(background prefetch →
_run_dialectic_depth()) and thehoncho_reasoningtool handler. So the toolpath inherited a budget meant only for recurring injection. The truncation is purely client-side —
Honcho returns the full answer (verified by replaying the same query with a direct HTTP call to the
backend
chatendpoint).Skipping the cap on the tool path is safe, not unbounded: the auto-injection path already has its own
token-based budget (
contextTokens, enforced inprefetch()via_truncate_to_budget()), and toolresults are already bounded server-side by Honcho's dialectic
MAX_OUTPUT_TOKENS— consistent withsibling tools (
honcho_search,honcho_context) which don't post-clip either.Related Issue
Fixes #59469
Type of Change
Changes Made
plugins/memory/honcho/session.py: addapply_injection_cap: bool = Truetodialectic_query(); thedialecticMaxCharstruncation now runs only when it'sTrue. Default preserves current behavior for all existing callers.plugins/memory/honcho/__init__.py: thehoncho_reasoningtool handler passesapply_injection_cap=False.plugins/memory/honcho/client.py: clarify thedialectic_max_charsfield comment (injection-only).tests/honcho_plugin/test_session.py: newTestDialecticInjectionCap(injection path still truncates with" …"; tool path returns the full answer); updated the existinghoncho_reasoningdispatch assertion for the new kwarg.Fully backward compatible — the parameter defaults to
True, so auto-injection is unchanged and no config migration is needed.How to Test
Manual: with a peer whose memory yields a >600-char synthesized answer, call
honcho_reasoning(e.g. "Summarize known facts about this peer and communication preferences."). Before: the result
ends in
" …", cut mid-word. After: the full answer is returned.Checklist
Code
fix(honcho): …)Documentation & Housekeeping
dialectic_querydocstring,dialectic_max_charscomment)cli-config.yaml.exampleif I added/changed config keys — N/A (no new config key)scripts/check-windows-footguns.pyreports no footgunsScreenshots / Logs
N/A — behavior is text truncation; see How to Test for before/after.
Note for existing users
Anyone who bumped
dialecticMaxCharsinhoncho.jsonas a workaround for truncatedhoncho_reasoninganswers can revert it to the default
600after this lands — the cap no longer affects tool results.Open question for maintainers
The auto-injection path now has two overlapping budgets: char-based
dialecticMaxChars(always-ondefault guardrail) and token-based
contextTokens(opt-in, enforced at the injection layer). This PRkeeps both and only fixes the mis-scoped tool-path clip. If you'd prefer the injection budget
consolidated onto a single token-based control, happy to follow up — larger change, out of scope here.