Skip to content

fix(error_classifier): avoid large-context false overflow heuristics - #19723

Merged
teknium1 merged 1 commit into
mainfrom
hermes/hermes-8c54fd4a
May 4, 2026
Merged

fix(error_classifier): avoid large-context false overflow heuristics#19723
teknium1 merged 1 commit into
mainfrom
hermes/hermes-8c54fd4a

Conversation

@teknium1

@teknium1 teknium1 commented May 4, 2026

Copy link
Copy Markdown
Contributor

Salvage of #16352 onto current main.

Summary

Generic HTTP 400 responses and server disconnects were being classified as context_overflow on 1M-context sessions just because they had hundreds of messages. Absolute thresholds (approx_tokens > 120_000, num_messages > 200) are only valid proxies for smaller context windows. Gate the absolute thresholds on context_length <= 256000 so large-context sessions rely on the percentage-based check instead.

Validation

Manual review of diff.

Original PR: #16352

Generic 400 and server-disconnect heuristics used absolute token/message-count fallbacks that are too aggressive for 1M context sessions. Gate those absolute fallbacks to smaller context windows while preserving relative pressure checks.

Fixes #16351
@teknium1
teknium1 merged commit d29f90e into main May 4, 2026
7 of 10 checks passed
@teknium1
teknium1 deleted the hermes/hermes-8c54fd4a branch May 4, 2026 12:04
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint labels May 4, 2026
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 type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants