fix(agent): reject stale 32k metadata for MiniMax - #24436
Conversation
|
Thanks for isolating the stale-MiniMax metadata path. The core premise remains present on current main: Problems
Suggested changes
This is an automated hermes-sweeper review. |
GottZ
left a comment
There was a problem hiding this comment.
This was generated by AI during triage.
Summary
Two PRs address the same root cause: stale 32K cache/OpenRouter metadata is accepted for MiniMax models whose actual fallback context is 204,800 tokens. Both diffs add MiniMax detection, unify the existing Kimi/MiniMax stale-underreport predicate, apply it to three resolution paths, and add equivalent regression coverage.
Related pull requests
- #24436
related— (+69/-9) — keep open, but update before merge: the diff invalidates stale MiniMax cache entries and rejects 32K metadata in the Nous and generic unknown-provider OpenRouter paths while preserving unrelated 32K values. As identified by the contributor keep_open review, current main now has an additional explicit provider="openrouter" path that this diff does not guard; salvage should apply the shared predicate there and add the requested regression test. - #24552 [closed]
duplicate— (+73/-8) — duplicate, closed in favor of #24436: its diff implements essentially the same shared MiniMax/Kimi predicate, three guard-site changes, and regression tests, so it remains relevant as the rebased comparison that previously resolved an _safe_ctx conflict. It does not provide a distinct fix to retain separately and likewise predates the explicit-OpenRouter-path requirement identified on #24436.
Duplicates
#24436 and #24552 implement essentially the same stale-32K MiniMax metadata fix; #24552 was closed in favor of #24436.
Suggested consolidation
Merge #24436 after rebasing it onto current main, extending the shared stale-underreport predicate to the explicit provider="openrouter" path, and adding an explicit-provider MiniMax 32K regression test, as required by the contributor keep_open review. Keep #24552 closed as the duplicate superseded by the consolidated #24436 implementation.
Complex graph
flowchart LR
classDef open fill:#dbeafe,stroke:#1d4ed8,color:#1e3a8a
classDef merged fill:#dcfce7,stroke:#15803d,color:#14532d
classDef closed fill:#e5e7eb,stroke:#6b7280,color:#1f2937
classDef unverified fill:#f3f4f6,stroke:#9ca3af,color:#374151
classDef best stroke-width:3px,stroke:#b45309
classDef target stroke-width:3px,stroke:#4338ca
subgraph Dup24436 ["PRs duplicating each other"]
P24436["PR #24436 (open)"]
P24552["PR #24552 (closed)"]
end
class P24436 open
class P24552 closed
class P24436 target
click P24436 "https://github.com/NousResearch/hermes-agent/pull/24436"
click P24552 "https://github.com/NousResearch/hermes-agent/pull/24552"
Graph: solid arrow = fixes / best fix, dashed arrow = partial or unverified (see edge label); boxed group = PRs duplicating each other; amber border = best fix; indigo border = target; gray node = closed or no verify verdict yet (state tag in the node label).
Cross-PR triage: Reviewed 2 pull requests and 0 issues in this complex. Each diff was read against this issue; Assessment working set: 14 kB of PR diffs, 3 kB of issue/PR text, 3 kB of discussion (4 comments), 1 verify verdict. verdicts reflect diff content, not PR titles. Part of an automated triage batch.
|
Merged via PR #85506 (merge commit 35720fb) — your commit was cherry-picked onto current main with your authorship preserved in git log. Your fix landed intact through two intervening merges to the same block (the generic pre-catalog guard from #85434 and the non-positive guard from #85507); the shared |
related #24140
Summary
Root Cause
get_model_context_length()already had a targeted guard for Kimi models that were wrongly underreported as32768by stale third-party metadata. MiniMax models still lacked the same protection.That left two failure paths for
#24140:32768cache entry forMiniMax-M2.7or related models would win before any provider fallback32768Either path tripped Hermes' existing 64K minimum-context guard and caused Telegram / cron failures even though MiniMax's real context window is 204800.
Testing
.\venv\Scripts\python -m pytest tests/agent/test_model_metadata.py tests/agent/test_minimax_provider.py