fix(mistral): enable prompt cache key compat#88976
Conversation
|
Codex review: needs maintainer review before merge. Reviewed June 1, 2026, 9:01 PM ET / 01:01 UTC. Summary PR surface: Source +80, Tests +205, Docs 0. Total +285 across 13 files. Reproducibility: yes. from source inspection: current main lacks Review metrics: 2 noteworthy metrics.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land this owner-boundary fix after maintainer compatibility sign-off: Mistral should declare cache-key support with long-retention disabled, transports should honor those separate flags, and doctor should migrate only known zero-cost bundled rows while preserving custom costs. Do we have a high-confidence way to reproduce the issue? Yes from source inspection: current main lacks Is this the best way to solve the issue? Yes, this is the right owner-boundary shape if maintainers accept the upgrade semantics: the Mistral plugin owns the compat declaration, shared transports honor generic flags, and doctor handles old persisted bundled defaults. The remaining question is compatibility acceptance, not a narrower code defect. AGENTS.md: found and applied where relevant. Codex review notes: model gpt-5.5, reasoning high; reviewed against 459abfc26baf. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +80, Tests +205, Docs 0. Total +285 across 13 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
1dc3236 to
b150a44
Compare
|
Rebased onto latest @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
b150a44 to
adcb9a7
Compare
|
Land-ready after maintainer rebase onto current Proof:
No known proof gaps. |
Fixes #83709.
Summary
prompt_cache_keycacheRead: 0costsVerification
node scripts/run-vitest.mjs src/commands/doctor-legacy-config.migrations.test.ts extensions/mistral/api.test.ts extensions/mistral/model-definitions.test.ts src/agents/openai-transport-stream.test.ts src/llm/providers/openai-completions.test.tspnpm exec oxlint src/commands/doctor/shared/legacy-config-core-normalizers.ts src/commands/doctor/shared/legacy-config-compatibility-base.ts src/commands/doctor-legacy-config.migrations.test.tsgit diff --checkReal behavior proof
Behavior addressed: Bundled Mistral OpenAI-compatible models advertise
supportsPromptCacheKey: true(without unsupported long retention); cached reads are priced at the documented nonzero Mistral rate; and doctor migration upgrades persisted bundled Mistral rows still carryingcacheRead: 0while preserving custom nonzero cached-read costs.Real environment tested: Linux x86_64, Node.js v22.22.0, HEAD
b150a44ecc8af8b75d98ce90b82159c94418e379rebased ontoorigin/main086274fd7e7a33d7085c95373b19cd18945c4b59. The rebase carried only type-level adjustments (a generic onnormalizeLegacyMistralModelCostto preserve the input type, and areasoning: falsetest fixture field now required byModelDefinitionConfig) with no runtime behavior change. Production functions are driven directly vianode --import tsx, plus the focused Vitest suites.Exact steps or command run after this patch:
Evidence after fix:
Observed result after fix: The bundled Mistral model advertises
supportsPromptCacheKey: truewith long retention disabled; doctor migration rewrites the stale bundledcacheRead: 0row to the documented0.05rate while leaving the custom0.5row untouched; the focused Mistral suites pass 16/16. CIcheck-test-types/check-prod-types/check-lintare green on this head.What was not tested: A live Mistral API cache hit (no
MISTRAL_API_KEYin this environment); cache-hit timing is best-effort. The fix is exercised through the production compat / model-definition / migration functions and unit tests rather than a live cache cycle.