Repository navigation
fix(cache): report allowlist entries a model revision left stale - #1348
Conversation
Cache routing plans a request only when its exact artifact tuple is in EIGENINFERENCE_CACHE_ROUTING_ALLOWED_ARTIFACTS. Publishing new weights or a new template under the same model ID changes the tuple, so the model silently lost cache routing until an operator appended the new one. Nothing reported it; this is how nvidia-nemotron-3.5-lightning fell to 0% cache hits. Count such models as artifact_allowlist.stale_models in GET /v1/cache/status, with Prometheus and Datadog gauges, and name each live tuple once in the coordinator log. The public status still exposes no model IDs or hashes. Routing and the allowlist's exact-match rule are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Threat model review — advisoryReviewed head Review not completed for this head. Previous findings are superseded, not confirmed resolved. Models: budgeted Sonnet / selective Opus / selective Sol 6.1. Findings require human validation; this review never requests changes or blocks merging. Coverage: 0/0 source units; cross-file integration pending. 0 selected depth batch(es) pending. All threat definitions indexed; relevant full definitions selected. Unchanged callers are not scanned. Cost this run: $0.0000 reported, $0.0000 reserved with unknown cost; 0 paid request(s), 0 reused batch(es), 0 provider cache-hit tokens. Saved findings and earlier report · Historical findings are not confirmed resolved. |
|
@codex review this |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Chef's kiss. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
The base now contains master bf3dc67. Four documentation pages conflicted with the allowlist stale-entry reporting change (#1348) and the CI and provider-test notes on master: - docs/developer/navigation.md: master's allowlist row and this branch's retained-byte budget row are both kept. - docs/developer/test.md: master's new paragraphs and this branch's attempt-budget paragraph are both kept. - docs/architecture/cache-aware-routing.md and docs/reference/telemetry-inventory.md: only the "Last updated" stamps conflicted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Summary
OpenRouter reports a 0% cache-hit rate for
nvidia-nemotron-3.5-lightningwhile other models keep theirs. The cause is operational: new Nemotron weights were published under the same model ID on 2026-10-04 21:48 UTC, which changed the model's cache-routing tuple, and the coordinator's exact-artifact allowlist still names the previous one. Every Nemotron request is therefore planned asineligibleand served without cache routing. Nothing reports that state today.This PR makes the coordinator report it: a
stale_modelscount inGET /v1/cache/statuswith matching gauges, and one log warning per stale artifact that carries the exact tuple to append. Routing behaviour and the allowlist's exact-match rule are unchanged, so this does not restore Nemotron's hits by itself. That needs the allowlist change under "Production fix" below.Linked issue
None.
Root cause
PlanCacheRouteWithResultonly plans a request whose(model_id, model_aggregate_sha256, prompt_contract_id)is inEIGENINFERENCE_CACHE_ROUTING_ALLOWED_ARTIFACTS. A revision changes the tuple, and promotion does not update the list (step 5 ofdocs/operations/model-revisions.md).2026-09-09-r12026-09-30-r1model_aggregate_sha256be622ff6ae88…366d9285ec36…chat_template.jinja,config.json,generation_config.jsonEvidence, all from public read-only endpoints on 2026-10-05 between 05:26 and 05:35 UTC:
GET /v1/models/catalogand the Nemotron manifest show the live revision and hashes above.GET /v1/cache/statusshows the allowlist is configured (count: 26) and cache routing is healthy overall since the 00:18 UTC restart: 719,958 requests evaluated, 631,034 planned, 73,262 SSD hits. That is consistent with one model being excluded and inconsistent with a fleet-wide fault.GET /healthshows build5b7a675c, so none of the code merged after it is involved.I could not read the production allowlist, so the missing entry is inferred, not observed. One read confirms it (see "Production fix").
None of the PRs merged on 2026-10-04 changes this gate. The
revised weightscase inTestCacheArtifactAllowlistRejectsBeforeActivationAndSidecarshows the decline is the intended behaviour.Production fix
Confirm, then append the live tuple and restart through the approved procedure:
{"model_id":"nvidia-nemotron-3.5-lightning","model_aggregate_sha256":"366d9285ec367633c25b5c064ad94482e04be043c2a515a16e4fcf12c0a8f85b","prompt_contract_id":"bff76b44b69191cc1fdc8798da78efe1464d81828c030cf8109d6888d4c66717"}The contract ID is the coordinator's own
promptcontract.ContractIDover the live manifest's tokenizer, template and config entries at normalization v8 and renderer v4. An independent reimplementation gives the same value, and the same reimplementation reproduces the runbook's recordedternary-bonsai-2-27bcontract ID (ce88a818…) at the versions in force when it was derived. Keep the previous tuple while providers converge.What changed
ArtifactAllowlist.StaleForreports a live artifact whose model the list names only under other tuples. A model that was never listed is excluded on purpose and is not stale.Registry.MissingCacheRoutingAllowlistEntriesapplies that to the catalog's live artifacts and returns the tuples to append.ExactCacheStatusSnapshotcounts them asartifact_allowlist.stale_modelswhile routing ison. The public status still exposes no model IDs or hashes.warnNewlyMissingAllowlistEntriesnames each missing tuple in the coordinator log once, and again if it recurs after recovering.exact_cache_artifact_allowlist_stale_modelsandexact_cache.artifact_allowlist.stale_models.The count reads the catalog's published identities, which exist before an artifact's files are fetched, so a catalog sync does not make it dip to zero or repeat the warning.
Before
flowchart TD P["Publish Nemotron revision 2026-09-30-r1<br/>same model ID, new hashes"] --> C["Catalog serves aggregate 366d9285"] C --> Q["PlanCacheRouteWithResult"] Q --> A{"ArtifactAllowlist.Allows<br/>list names be622ff6"} A -->|no match| I["Outcome ineligible<br/>no scope, no sidecar plan"] I --> Z["Nemotron cache hits 0%"] A -.->|nothing reports the mismatch| S["GET /v1/cache/status<br/>artifact_allowlist: configured, count"] classDef flow fill:#1e40af,color:#fff,stroke:#93c5fd; classDef bad fill:#991b1b,color:#fff,stroke:#fca5a5; classDef blind fill:#374151,color:#fff,stroke:#9ca3af; class P,C,Q,A flow; class I,Z bad; class S blind;Blue is the unchanged planning path, red is the outcome and grey is the status that could not show it.
After
flowchart TD P["Publish Nemotron revision 2026-09-30-r1<br/>same model ID, new hashes"] --> C["Catalog serves aggregate 366d9285"] C --> Q["PlanCacheRouteWithResult"] Q --> A{"ArtifactAllowlist.Allows<br/>list names be622ff6"} A -->|no match| I["Outcome ineligible<br/>unchanged"] C --> T["missingAllowlistEntries<br/>ArtifactAllowlist.StaleFor"] T --> S["GET /v1/cache/status<br/>artifact_allowlist.stale_models: 1"] T --> L["Log warning, once<br/>model_id, aggregate, contract ID"] S --> O["Operator appends the logged tuple and restarts"] L --> O O --> H["Allows matches<br/>requests are planned again"] classDef flow fill:#1e40af,color:#fff,stroke:#93c5fd; classDef bad fill:#991b1b,color:#fff,stroke:#fca5a5; classDef added fill:#166534,color:#fff,stroke:#86efac; class P,C,Q,A flow; class I bad; class T,S,L,O,H added;Green is new: the same decline, now counted and named.
Test plan
Pinned Go 1.25.0,
-p 1, on the final combined version at base8714e56d. The branch was then moved onto55b5ad5a(#1253), which changes no file undercoordinator/,go.mod,go.sumor the lint configuration, so the Go results carry over; the docs-impact check was rerun on the new base.ContractIDover the live manifest isbff76b44…. With the allowlist naming the previous revision and the catalog serving the live one,PlanCacheRouteWithResultreturnsineligibleand never calls the sidecar. With the live tuple appended, planning proceeds to the sidecar.go test -count=1 ./...incoordinator/: 95 test packages pass, 0 fail, including the layout guard. PostgreSQL-backed tests are skipped (DATABASE_URLunset).go test -race -count=1 ./tests/registry/ ./tests/api/inference/ ./tests/api/inference/contracts/: pass.gofmt -lempty;go vet ./...clean;golangci-lint runv2.1.6 reports 0 issues;git diff --checkclean.make docs-impact-check BASE=origin/master: 18 changed files, coverage OK.TestCacheArtifactAllowlistMissingEntriesAreLiveArtifactsOfListedModels: unrestricted list, empty list, revisions of a listed model, appended revision.TestExactCacheStatusCountsModelsListedOnlyUnderASupersededArtifact: seven cases including a never-listed model, previous weights, previous template and routing off. Asserts the status JSON contains no model ID or hash, and the gauge value.TestStaleAllowlistCountDoesNotWaitForArtifactDownload.TestStaleAllowlistWarningNamesTheMissingTupleOncePerOccurrence: one warning across repeated reads, none after the tuple is appended, one more on recurrence.make docs-check: the six changed docs pass. The full run reports 7 broken links, all into thelibs/mlx-swift-lmsubmodule, which is not initialized in my checkout. This relies on CI's Docs Lint.Refactor pass
A dedicated refactor subagent reviewed the first working version, as
AGENTS.mdrequires. Its behaviour-preserving changes:It kept the three-package split and found one robustness issue, which I then fixed: the first version only considered artifacts whose files were ready, so every catalog sync briefly reported zero and repeated the warning. The validation below ran on the combined final version.
Components touched
Protocol / interface changes
GET /v1/cache/statusgains the integerartifact_allowlist.stale_models. Existing fields are unchanged and nothing consumes the new one yet.Documentation impact
docs/reference/api-contracts.md(field and gauges),docs/reference/telemetry-inventory.md(gauge),docs/operations/cache-routing-rollout.md(new "Stale entries after a model revision" section, a verification bullet, and a note that the September literal tuples no longer match a current build),docs/operations/model-revisions.md(step 5),docs/architecture/cache-aware-routing.md(mechanism and code map),docs/developer/navigation.md(ownership row), andCHANGELOG.md.Notes for reviewers
ContractIDhashes the normalization and renderer versions, so a coordinator release that bumps either (as Fix Nemotron prompt parity and first-byte/cache regressions #962 did) makes every listed tuple stale at once.stale_modelswould then equal the number of listed models.🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.