fix(honcho): filter deriver noise and label dialectic context injection#25344
Open
ayushere wants to merge 3 commits into
Open
fix(honcho): filter deriver noise and label dialectic context injection#25344ayushere wants to merge 3 commits into
ayushere wants to merge 3 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Filters out deriver-style non-response strings from Honcho dialectic results and wraps valid results with a markdown header.
Changes:
- Adds heuristic filter for "nothing to save", "no new information", etc.
- Prepends
## Honcho Contextual Analysisheader to valid dialectic output.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+677
to
+683
| _dr = dialectic_result.strip().lower() | ||
| _is_deriver_noise = ( | ||
| _dr.startswith("nothing to save") | ||
| or _dr.startswith("no new information") | ||
| or _dr.startswith("no information") | ||
| or (_dr.startswith("nothing") and len(_dr) < 120) | ||
| ) |
| _dr.startswith("nothing to save") | ||
| or _dr.startswith("no new information") | ||
| or _dr.startswith("no information") | ||
| or (_dr.startswith("nothing") and len(_dr) < 120) |
Comment on lines
+677
to
+684
| _dr = dialectic_result.strip().lower() | ||
| _is_deriver_noise = ( | ||
| _dr.startswith("nothing to save") | ||
| or _dr.startswith("no new information") | ||
| or _dr.startswith("no information") | ||
| or (_dr.startswith("nothing") and len(_dr) < 120) | ||
| ) | ||
| if not _is_deriver_noise: |
| or (_dr.startswith("nothing") and len(_dr) < 120) | ||
| ) | ||
| if not _is_deriver_noise: | ||
| parts.append(f"## Honcho Contextual Analysis\n{dialectic_result.strip()}") |
- Move noise-phrase list to module-level constant _DERIVER_NOISE_PHRASES
with a comment explaining origin (deriver prompt wording) and why
bare startswith('nothing') is excluded to avoid false positives
- Replace magic inline tuple with any(startswith) against the constant
- Rename local vars _dr -> normalized, _is_deriver_noise -> is_deriver_noise
(underscore prefix is unconventional for ordinary locals)
- Add 'no relevant information', 'nothing relevant', 'nothing notable'
to cover likely phrasing variants
25ee528 to
881553f
Compare
881553f to
7b74895
Compare
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
HonchoMemoryProvider.prefetch(), the dialectic result was appended raw topartswith no label and no validation, so deriver-style non-responses like"Nothing to save. Two greeting exchanges, no work done."got injected verbatim as<memory-context>, causing the main LLM to echo that text instead of answering the user."nothing to save","no new information","no information", or short"nothing …"strings) before injection, and labels valid results with a## Honcho Contextual Analysisheading so the LLM can distinguish memory context from user input.Root cause
_run_dialectic_depth()occasionally returns deriver-style housekeeping strings instead of actionable memory context, especially on sparse sessions (few turns, greeting-only exchanges). These strings passed the existingdialectic_result.strip()guard and were appended without sanitization. The main model received the<memory-context>block containing the non-response, matched its instructed pattern of "answer what's in context," and reproduced the noise string verbatim as its reply — breaking the persona entirely for that turn.Test
prefetch()so_run_dialectic_depth()fires."Nothing to save. Two greeting exchanges, no work done.".## Honcho Contextual Analysisheading in the injected context.