fix(agent): preserve MiniMax context length on delta-only overflow

This commit is contained in:
maelrx 2026-04-13 15:12:55 -03:00 committed by Teknium
parent a884f6d5d8
commit e020f46bec
3 changed files with 109 additions and 1 deletions

View file

@ -621,6 +621,10 @@ class TestParseContextLimitFromError:
msg = "Error: context window of 4096 tokens exceeded"
assert parse_context_limit_from_error(msg) == 4096
def test_minimax_delta_only_message_returns_none(self):
msg = "invalid params, context window exceeds limit (2013)"
assert parse_context_limit_from_error(msg) is None
def test_completely_unrelated_error(self):
assert parse_context_limit_from_error("Invalid API key") is None