mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-11 03:31:55 +00:00
redact secrets from summarizer output and add test coverage
This commit is contained in:
parent
dacb629028
commit
fcae077d65
2 changed files with 83 additions and 1 deletions
|
|
@ -469,7 +469,9 @@ The user has requested that this compaction PRIORITISE preserving all informatio
|
|||
# Handle cases where content is not a string (e.g., dict from llama.cpp)
|
||||
if not isinstance(content, str):
|
||||
content = str(content) if content else ""
|
||||
summary = content.strip()
|
||||
# Redact the summary output as well — the summarizer LLM may
|
||||
# ignore prompt instructions and echo back secrets verbatim.
|
||||
summary = redact_sensitive_text(content.strip())
|
||||
# Store for iterative updates on next compaction
|
||||
self._previous_summary = summary
|
||||
self._summary_failure_cooldown_until = 0.0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue