Skip to content

fix(error_classifier): stop empty-response advisories from triggering compression - #66818

Merged
teknium1 merged 2 commits into
NousResearch:mainfrom
HexLab98:fix/empty-response-max-tokens-misclass
Jul 18, 2026
Merged

fix(error_classifier): stop empty-response advisories from triggering compression#66818
teknium1 merged 2 commits into
NousResearch:mainfrom
HexLab98:fix/empty-response-max-tokens-misclass

Conversation

@HexLab98

@HexLab98 HexLab98 commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Provider empty-response advisories (e.g. nano-gpt / OpenRouter) say "very low max_tokens" as a possible cause. That literal substring used to match _CONTEXT_OVERFLOW_PATTERNS, so Hermes misclassified the error as context overflow, entered the compression loop, and ended in "Cannot compress further" on otherwise healthy sessions.
  • Tighten overflow matching to specific `max_tokens exceeded` phrasing and classify empty-response advisories as retryable `server_error` without compression.

Test plan

  • `scripts/run_tests.sh tests/agent/test_error_classifier.py -q` (199 passed)
  • Reproduce with a custom endpoint that returns the empty-response advisory and confirm Hermes retries instead of compressing.

@alt-glitch alt-glitch added type/bug Something isn't working comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint provider/openrouter OpenRouter aggregator P2 Medium — degraded but workaround exists labels Jul 18, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.
Related to the prior empty-response handling work in #5278 and #4552, but this patch fixes the distinct false context-overflow/compression classification.

HexLab98 added 2 commits July 18, 2026 15:29
… compression

Provider empty-reply text mentions "very low max_tokens", which used to match
the bare overflow pattern and thrash compress until "Cannot compress further".
@HexLab98
HexLab98 force-pushed the fix/empty-response-max-tokens-misclass branch from be3bfc7 to 4ac928c Compare July 18, 2026 08:31
@teknium1
teknium1 merged commit 862b1b3 into NousResearch:main Jul 18, 2026
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint P2 Medium — degraded but workaround exists provider/openrouter OpenRouter aggregator type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants