Skip to content

fix(agent): reject stale 32K metadata underreports for MiniMax (extends Kimi guard) - #85506

Merged
teknium1 merged 2 commits into
mainfrom
fix/minimax-32k-underreport-guard
Aug 13, 2026
Merged

fix(agent): reject stale 32K metadata underreports for MiniMax (extends Kimi guard)#85506
teknium1 merged 2 commits into
mainfrom
fix/minimax-32k-underreport-guard

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

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

Result
test_model_metadata.py + test_minimax_provider.py 99/99 pass
Stale-base gate 0 behind, 3-file diff

Infographic

MiniMax 32K underreport guard

@alt-glitch alt-glitch added type/bug Something isn't working comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint provider/minimax MiniMax (Anthropic transport) P2 Medium — degraded but workaround exists labels Aug 13, 2026
@github-actions

github-actions Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

૮ >ﻌ< ა ci review

ran on 9940fcf — chore: map contributor email

⚠️ Warnings

OSV vulnerability scan · View job

5 known vulnerabilities found in pinned dependencies.

How to fix:

Review the findings in the Security tab. Update the affected dependencies if a patched version is available.


debug info

CI timings

CI timings · View report · View job

Wall time 4m6s vs 6m37s (-38.0%). 14 job(s) slower, 8 faster, 2 unchanged.

  • Python tests / Run tests slice 5/12: +37.0s
  • Python tests / Run tests slice 2/12: +30.0s
  • OS-specific tests / Windows-only tests: +15.0s
  • Python tests / Run tests slice 7/12: -13.0s
  • Python tests / Run tests slice 11/12: -11.0s

@teknium1
teknium1 force-pushed the fix/minimax-32k-underreport-guard branch from fdac12a to 9940fcf Compare August 13, 2026 18:07
@teknium1
teknium1 merged commit 35720fb into main Aug 13, 2026
45 checks passed
@teknium1
teknium1 deleted the fix/minimax-32k-underreport-guard branch August 13, 2026 18:12
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 provider/minimax MiniMax (Anthropic transport) type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants