fix(agent): reject stale 32K metadata underreports for MiniMax (extends Kimi guard) - #85506
Merged
Conversation
Contributor
૮ >ﻌ< ა ci reviewran on 9940fcf — chore: map contributor email
|
teknium1
force-pushed
the
fix/minimax-32k-underreport-guard
branch
from
August 13, 2026 18:07
fdac12a to
9940fcf
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
MiniMax M2-family models wrongly capped at 32K: stale third-party metadata underreports them as 32,768 (real window 204,800), and both the persisted cache and the OpenRouter/Nous fallback paths trusted it — tripping the 64K minimum and breaking previously-working setups after upgrade. This extends the existing Kimi 32K-underreport guard to a shared
_model_name_suggests_stale_32k_underreport()covering both families.Salvages #24436 by @luoxiao6645 (cherry-picked, authorship preserved; resolves the remaining half of #24140's class that our generic pre-catalog guard in #85434 did not cover — that guard handles persisted pre-catalog values, this one rejects live 32K underreports).
Changes
agent/model_metadata.py:_model_name_suggests_minimax()+_model_name_suggests_stale_32k_underreport(); the step-1 cache invalidation, the Nous-path_safe_ctx, and the step-6 OpenRouter guard now cover MiniMax alongside Kimi.tests/agent/test_model_metadata.py: cache-invalidation, OR-fallback-rejection, and non-MiniMax-safety tests (contributor's), conflict-resolved onto the current generic-guard code.Validation
test_model_metadata.py+test_minimax_provider.pyInfographic