fix(error_classifier): narrow max_tokens pattern to avoid matching empty-response advisories (#66818) - #66937
Conversation
…pty-response advisories (NousResearch#66818) Empty-response advisories (e.g. nano-gpt / OpenRouter) say 'very low max_tokens' as a possible cause. The literal substring 'max_tokens' matched _CONTEXT_OVERFLOW_PATTERNS, causing Hermes to misclassify the error as context overflow, enter the compression loop, and end in 'Cannot compress further'. Narrowed 'max_tokens' to 'max_tokens limit' so advisory text does not match while real overflow messages (which always reference the limit) still do.
|
Thanks for this, @webtecnica — you nailed the exact root cause (the bare We landed the fix in #66818 (merged as 032a424). It takes a slightly different approach than narrowing Closing as redundant, but your diagnosis was spot-on. Appreciate you catching it. |
Summary
Empty-response advisories (e.g. nano-gpt / OpenRouter) include
very low max_tokensas a possible cause. The literal substringmax_tokensmatched_CONTEXT_OVERFLOW_PATTERNS, causing Hermes to misclassify the error as context overflow, enter the compression loop, and end withCannot compress further.Fix
Narrowed
max_tokens→max_tokens limitin_CONTEXT_OVERFLOW_PATTERNS.very low max_tokensno longer matches (does not containlimit)exceeds the max_tokens limitstill matchVerification
python3 -m py_compile agent/error_classifier.py✅max_tokens is not supportedfalse positive is already guarded by the request-validation check that runs before context_overflow)max_tokensalone matches an overflowCloses #66818