fix(model): invalidate stale MiniMax-M3 cache entries up to 512K - #43469
fix(model): invalidate stale MiniMax-M3 cache entries up to 512K#43469annguyenNous wants to merge 1 commit into
Conversation
models.dev reports MiniMax-M3 context as 512K, which gets cached. The previous invalidation threshold was <= 204,800, so 512K cache entries survived and were returned instead of the correct 1M value from the hardcoded catalog. Fix: compare cached value against the catalog entry (1M) instead of a hardcoded 204,800 threshold. Fixes NousResearch#43400
|
Related: competing fix for #43400 with #43464. This PR widens the stale-cache invalidation threshold to the catalog value; #43464 prefers OpenRouter metadata before models.dev. Both target the same MiniMax-M3 512K-vs-1M resolution bug — part of the saturated M3 context cluster (#37289, #38298, #37235, #37335). Maintainer should pick one mechanism. |
|
Closing in favour of #43464 ('[verified] fix minimax m3 context resolution'), which is the canonical fix for this bug and has been approved. Relationship analysis: Both PRs touch
#43464 is the more complete and correct fix. Your cache invalidation widening (204K → <1M) is a valid guard for already-persisted stale entries, but the coverage is subsumed: once #43464 lands, new resolutions will go through OR and cache the correct value. The widened boundary is a nice-to-have that can be re-evaluated as a follow-up if any users still hit stale-cache issues post-merge of #43464. |
austinpickett
left a comment
There was a problem hiding this comment.
✅ Approved
What it fixes: The stale MiniMax-M3 cache invalidation threshold was <= 204_800. models.dev can return 512K for M3, which also gets cached as a stale pre-catalog value. The fix raises the threshold to < DEFAULT_CONTEXT_LENGTHS.get('minimax-m3', 1_000_000) — dropping any value below the canonical 1M entry.
Correctness: The threshold is read from the catalog dict itself, so if the catalog value ever changes the threshold tracks automatically. Falls back to 1M if key missing.
Note: PR #43464 also touches model_metadata.py at line ~1118 (resolution priority path) — these are different code locations (invalidation block vs. resolution block), not a semantic conflict. Both can merge cleanly.
Reviewed by Hermes Agent
Fixes #43400
Problem
MiniMax M3 supports 1M context, but Hermes displays 512K. The root cause is a stale cache entry:
models.devreports MiniMax-M3 context as 512K, which gets persisted to the context cachemodel_metadata.py:1621wascached <= 204_800Fix
Change the cache invalidation threshold from a hardcoded
<= 204_800to a dynamic comparison against the catalog value (DEFAULT_CONTEXT_LENGTHS["minimax-m3"]= 1M). Any cached value below the catalog entry is now invalidated and re-resolved.Testing
ast.parse()passes