[verified] fix minimax m3 context resolution - #43464
Conversation
|
Related: competing fix for #43400 with #43469. This PR prefers OpenRouter metadata before models.dev for MiniMax providers; #43469 widens the stale-cache invalidation threshold. Both target the same M3 512K-vs-1M bug (saturated cluster #37289/#38298/#37235). Note this PR also touches |
austinpickett
left a comment
There was a problem hiding this comment.
Canonical fix for the MiniMax-M3 context resolution bug. Four-file diff, well-structured.
model_metadata.py (line ~1118): Inserts a MiniMax-specific early lookup via _resolve_nous_context_length (OpenRouter catalog) before the models.dev fallback, for any model with effective_provider in {"minimax", "minimax-cn"}. This directly addresses the root cause: models.dev was returning 512K for M3, which OpenRouter correctly reflects as 1,048,576. Sound approach.
tests/agent/test_minimax_provider.py: + test_minimax_m3_resolves_to_one_million correctly exercises M3 slugs (bare, lower-case, dated variant) and asserts 1,048,576. Good coverage.
hermes_cli/profiles.py: The _make_writable rmtree error callback is a self-contained fix for macOS immutable-flag deletion failures. Clean, defensive, properly tested. Reasonable to include here, though technically unrelated to MiniMax.
tests/hermes_cli/test_profiles.py: test_deletes_read_only_contents exercises the retry path. The monkey-patching of os.unlink is a pragmatic approach given the macOS-only nature of chflags.
Relationship to #43469: Both PRs touch agent/model_metadata.py but at different line ranges — #43469 modifies the stale-cache invalidation block (~line 1621) while this PR modifies the resolution-order block (~line 1118). They are complementary rather than conflicting. This PR addresses the root cause (prefer OR over models.dev for MiniMax). The cache-invalidation widening from #43469 remains a useful guard for users with already-persisted 512K entries, but that's separable; this fix is the more important path. Closing #43469 with a pointer here.
✅ Approved.
austinpickett
left a comment
There was a problem hiding this comment.
✅ Approved
What it fixes (two independent changes):
-
agent/model_metadata.py— For MiniMax providers, call_resolve_nous_context_length()(OpenRouter-backed) before falling through tomodels.dev.models.devcan return stale 512K for M3; OR has the correct 1,048,576. Priority fix is correct and guards behindeffective_provider in {"minimax", "minimax-cn"}so only MiniMax is affected. -
hermes_cli/profiles.py—_make_writableerror callback forshutil.rmtreeondelete_profile. Handles macOS immutable flags (chflags) and Windows read-only dirs. Good defensive implementation.
Note: PR #43469 also touches model_metadata.py at line ~1612 (cache invalidation threshold) — non-overlapping hunk, both can merge cleanly as complementary fixes.
Reviewed by Hermes Agent
|
Thanks for the focused MiniMax investigation. This automated hermes-sweeper review found that current
Closing as already implemented on main. |
Summary
tests/agent/test_minimax_provider.py.Closes #43400.
Verification
python3 -m py_compile agent/model_metadata.py tests/agent/test_minimax_provider.pypython3 -m pytest --override-ini addopts="" -q tests/agent/test_minimax_provider.py