mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-25 00:51:20 +00:00
feat(compression): summaries now respect the conversation's language
Context compaction summaries were always produced in English regardless of the conversation language, which injected English context into non-English conversations and muddied the continuation experience. Adds a one-sentence instruction to the shared `_summarizer_preamble` used by both the initial-compaction and iterative-update prompt paths. Placing it in the preamble (rather than adding it separately to each prompt) means both code paths stay in sync with one edit. Ported from anomalyco/opencode#20581. The original PR (#4670) landed before main's prompt templates were refactored to share the `_summarizer_preamble` and `_template_sections` blocks, so the cherry-pick conflicted on the now-obsolete inline sections; re-applied the essential one-line change on top of the current structure. Verified: 48/48 existing compressor tests pass.
This commit is contained in:
parent
7bd1a3a4b1
commit
13294c2d18
1 changed files with 3 additions and 1 deletions
|
|
@ -633,7 +633,9 @@ class ContextCompressor(ContextEngine):
|
|||
"assistant that continues the conversation. "
|
||||
"Do NOT respond to any questions or requests in the conversation — "
|
||||
"only output the structured summary. "
|
||||
"Do NOT include any preamble, greeting, or prefix."
|
||||
"Do NOT include any preamble, greeting, or prefix. "
|
||||
"Write the summary in the same language the user was using in the "
|
||||
"conversation — do not translate or switch to English."
|
||||
)
|
||||
|
||||
# Shared structured template (used by both paths).
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue