Skip to content

fix(xai): drop stale 256K grok-4.6 context cache - #84341

Closed
Julientalbot wants to merge 1 commit into
NousResearch:mainfrom
Julientalbot:fix/grok-46-metadata
Closed

Julientalbot wants to merge 1 commit into
NousResearch:mainfrom
Julientalbot:fix/grok-46-metadata

Conversation

@Julientalbot

@Julientalbot Julientalbot commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Official card (docs.x.ai/developers/models/grok-4.6): 500,000 context.

#84661 landed the catalog. main already lists native grok-4.6 on the xAI picker. This PR is only the leftover cache guard.

Pre-catalog builds resolved grok-4.6 via the grok-4 catch-all (256K) and persisted it. After the catalog land the table is 500K, but a leftover cache entry still wins. Same pattern as the existing grok-4.3 guard.

Not in this PR

  • No catalog restatement
  • No picker / extras restatement (already on main)
  • No xhigh special-case
  • No tool-default flip 4.5 → 4.6

Test plan

  • uv run --extra dev pytest tests/agent/test_model_metadata.py::TestGrok46StaleCacheGuard tests/agent/test_model_metadata.py::TestGrok43StaleCacheGuard tests/agent/test_reasoning_stale_timeout_floor.py -q → 40 passed
  • CI green

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint comp/cli CLI entry point, hermes_cli/, setup wizard provider/xai xAI (Grok) sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades labels Aug 12, 2026
@lihongjie224

Copy link
Copy Markdown

Following this — grok-4.6 is already in the live xAI / models.dev catalog, but without this PR Hermes still treats it as the grok-4 catch-all (256K context, no reasoning.effort, no stale-think floor).

Any estimate on when this is likely to merge?

@Julientalbot

Copy link
Copy Markdown
Contributor Author

Landed on main via #84661 (3e09adb, merged 2026-08-12 17:37Z) — same catalog surface this PR was opened for:

  • DEFAULT_CONTEXT_LENGTHS["grok-4.6"] = 500000
  • _GROK_EFFORT_CAPABLE_PREFIXES includes grok-4.6
  • reasoning stale-timeout floor 300s

This branch is now CONFLICTING against that merge. Closing as superseded rather than rebasing a duplicate.

@lihongjie224 no remaining wait on this thread: pull current main (or until then model.context_length: 500000).

Delta this branch still had that #84661 did not: invalidate a persisted 256K cache leftover for grok-4.6 (same guard as grok-4.3). Only worth a tiny follow-up if that still bites after the catalog land.

@Julientalbot Julientalbot reopened this Aug 12, 2026
@alt-glitch alt-glitch mentioned this pull request Aug 12, 2026
@Julientalbot Julientalbot changed the title fix(xai): treat grok-4.6 as 4.5-class (500K, effort, think floor) fix(xai): grok-4.6 stale-256K cache guard + native picker slugs Aug 12, 2026
@Julientalbot

Copy link
Copy Markdown
Contributor Author

Reopened. Closing this against #84661 was a mistake on my side.

#84661 landed the catalog (500K / effort / floor) with no description and flipped the OpenRouter picker x-ai/grok-4.5 → x-ai/grok-4.6. It did not cover:

  • stale 256K cache invalidate (this branch, same pattern as grok-4.3)
  • native grok-4.6 on the xAI picker fallback/extras
  • catalog + cache tests

Rebuilt onto current main (e0f6c65e1). No longer a conflicting duplicate.

@Julientalbot Julientalbot changed the title fix(xai): grok-4.6 stale-256K cache guard + native picker slugs fix(xai): drop stale 256K grok-4.6 cache + list native slug Aug 12, 2026
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).

NousResearch#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).
@Julientalbot Julientalbot changed the title fix(xai): drop stale 256K grok-4.6 cache + list native slug fix(xai): drop stale 256K grok-4.6 context cache Aug 13, 2026
@Julientalbot

Copy link
Copy Markdown
Contributor Author

Rebuilt onto current main (9deb0302c).

Picker leftover is gone — main already has native grok-4.6 in _XAI_STATIC_FALLBACK / extras. This branch is now cache guard only (clone of grok-4.3) + TestGrok46StaleCacheGuard.

@teknium1

Copy link
Copy Markdown
Collaborator

Merged via PR #85434 — your commit was cherry-picked onto current main with your authorship preserved in git log (merged 91e550b). Thanks for self-pruning the parts #84661 superseded and keeping this a clean cache-guard delta, and for the E2E test.

On top of your commit we generalized the guard: the per-model _model_name_suggests_* predicates (grok-4.3, grok-4.6, minimax-m3) are now one generic _stale_pre_catalog_cache_entry() driven by a _PRE_CATALOG_STALE_KEYS set, so future pre-catalog leftovers only need a one-line catalog entry. Your TestGrok46StaleCacheGuard E2E test is preserved as-is.

@teknium1 teknium1 closed this Aug 13, 2026
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 comp/cli CLI entry point, hermes_cli/, setup wizard P2 Medium — degraded but workaround exists provider/xai xAI (Grok) sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants