Skip to content

Fix context compaction failures on temperature-restricted models#5608

Merged
teknium1 merged 1 commit into
NousResearch:mainfrom
MadKangYu:codex/fix-context-compression-temperature-cooldown
Apr 6, 2026
Merged

Fix context compaction failures on temperature-restricted models#5608
teknium1 merged 1 commit into
NousResearch:mainfrom
MadKangYu:codex/fix-context-compression-temperature-cooldown

Conversation

@MadKangYu

Copy link
Copy Markdown
Contributor

Summary

  • stop forcing a fixed temperature in context summary LLM calls
  • add a summary failure cooldown to avoid repeated compaction spam on persistent provider errors
  • downgrade repeated no-summary log noise to debug
  • add tests for no-temperature kwargs and cooldown behavior

Validation

  • /Users/yu/.hermes/hermes-agent/.venv/bin/python -m pytest -q /Users/yu/.hermes/hermes-agent/tests/agent/test_context_compressor.py
  • 36 passed

@MadKangYu

Copy link
Copy Markdown
Contributor Author

Follow-up context for reviewers:\n\nRepro seen in production logs:\n- context compaction repeatedly triggers summary generation\n- summary call fails with: \n- repeated failure leads to compaction retry loop + warning spam\n\nWhat this PR changes:\n1. Stops forcing a fixed temperature in context summary calls (lets provider/model defaults apply)\n2. Adds a short failure cooldown for summary generation to prevent immediate repeated failures\n3. Downgrades repeated no-summary noise to debug\n\nWhy this is safe:\n- If summary generation fails, compaction still proceeds without summary (existing fail-open behavior), but now avoids spam/retry storms.\n- Includes unit tests for no-temperature kwargs and cooldown behavior.\n\nLocal validation run:\nbringing up nodes...
bringing up nodes...

.................................... [100%]
=============================== warnings summary ===============================
tests/agent/test_context_compressor.py: 36 warnings
/Users/yu/.hermes/hermes-agent/tests/conftest.py:89: DeprecationWarning: 'asyncio.get_event_loop_policy' is deprecated and slated for removal in Python 3.16
loop = asyncio.get_event_loop_policy().get_event_loop()

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
36 passed, 36 warnings in 3.90s\n=> 36 passed

@MadKangYu

Copy link
Copy Markdown
Contributor Author

Correction (formatted cleanly):

Repro seen in production logs:

  • context compaction repeatedly triggers summary generation
  • summary call fails with: invalid temperature: only 1 is allowed for this model
  • repeated failure leads to compaction retry loop + warning spam

What this PR changes:

  1. Stops forcing a fixed temperature in context summary calls (lets provider/model defaults apply)
  2. Adds a short failure cooldown for summary generation to prevent immediate repeated failures
  3. Downgrades repeated no-summary noise to debug

Why this is safe:

  • If summary generation fails, compaction still proceeds without summary (existing fail-open behavior), but now avoids spam/retry storms.
  • Includes unit tests for no-temperature kwargs and cooldown behavior.

Local validation run:
/Users/yu/.hermes/hermes-agent/.venv/bin/python -m pytest -q /Users/yu/.hermes/hermes-agent/tests/agent/test_context_compressor.py
=> 36 passed

@teknium1 teknium1 merged commit b26e85b into NousResearch:main Apr 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants