fix(xai): drop stale 256K grok-4.6 context cache + generalize pre-catalog guard - #85434
Merged
Merged
Conversation
Contributor
૮ >ﻌ< ა ci reviewran on 14caecc — fix(model_metadata): generalize pre-catalog stale context-ca
|
docs.x.ai (2026-08-12): grok-4.6 is the flagship, 500K context. Live GET /v1/models lists grok-4.6 at context_length 500000 (no grok-4.6-latest alias). #84661 landed the catalog. Main already lists native grok-4.6 on the xAI picker. This is only the leftover cache guard (same pattern as grok-4.3): pre-catalog builds persisted the grok-4 catch-all (256K).
Replaces the per-model _model_name_suggests_grok_4_3/_grok_4_6/ _minimax_m3 stale-cache predicates with one generic _stale_pre_catalog_cache_entry() guard driven by _PRE_CATALOG_STALE_KEYS. A cached context length is dropped when the model resolves (longest-key-first, same as step 8) to a listed catalog key and the cached value is at or below what the old resolution path could have produced (largest shorter matching catch-all, or the 256K fallback). Also covers qwen3.6-plus, grok-4-fast, and grok-4.20 (the models PR #37684 requested guards for), absorbing that PR. _model_name_suggests_minimax_m3 is kept for its two non-cache callers (models.dev underreport guard, cache-control gating in agent_runtime_helpers).
teknium1
force-pushed
the
hermes/hermes-82921ad2
branch
from
August 13, 2026 17:15
e544ac9 to
14caecc
Compare
This was referenced Aug 13, 2026
Closed
20 tasks
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
Users who ran
grok-4.6before its 500K catalog entry landed keep a stale persisted 256K context length forever — this drops that leftover so it re-resolves, and generalizes the guard so the whole class (MiniMax-M3, Grok-4.3/-4.6/-4-fast/-4.20, qwen3.6-plus) is covered by one rule instead of per-model patches.Salvages #84341 by @Julientalbot (cherry-picked, authorship preserved), then widens per the never-patch-predicates rule; also absorbs the guards requested in #37684 by @AhmetArif0.
Changes
agent/model_metadata.py: cherry-picked grok-4.6 guard (@Julientalbot), then replaced the three per-model_model_name_suggests_*stale-cache predicates with one generic_stale_pre_catalog_cache_entry()driven by_PRE_CATALOG_STALE_KEYS. A cached value is dropped only when the model resolves (longest-key-first, same as step 8) to a listed catalog key AND the cached value is at or below what the old resolution path could have produced (largest shorter matching catch-all, or the 256K fallback). Probe-derived values above that threshold are never dropped._model_name_suggests_minimax_m3kept for its two non-cache callers.tests/agent/test_model_metadata.py: contributor'sTestGrok46StaleCacheGuardE2E test preserved; predicate unit tests migrated to the generic guard; newTestGenericPreCatalogStaleGuardcovering qwen3.6-plus / grok-4-fast / grok-4.20 incl. an E2E stale-drop-and-re-resolve.Validation
tests/agent/test_model_metadata.py+test_minimax_provider.pyInfographic