Skip cache_control stamping for kimi-k3 - #3
Open
ludoo wants to merge 1 commit into
Open
Conversation
The gateway does not strip Anthropic-style cache_control for kimi-k3, and the upstream API rejects it: 400 Upstream request failed: The parameter cache_control is not supported for model moonshotai/kimi-k3 Add "kimi-k3" to UNSUPPORTED_CACHE_MODEL_PATTERNS. The pattern is narrow because kimi-k2.7 accepts cache_control and must keep caching.
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.
kimi-k3 rejects
cache_control, so every request from pi fails with a 400 while the extension is active:This is the GLM problem with a new model and a different error string. The gateway is meant to strip Anthropic-style markers for downstream APIs that do not speak Anthropic, and for kimi-k3 it passes them through instead.
The fix adds
kimi-k3toUNSUPPORTED_CACHE_MODEL_PATTERNS, so the extension skips all stamping and showsopencode-go-cache: unsupportedin the footer.I kept the pattern at
kimi-k3rather thankimi, because kimi-k2.7 acceptscache_controland caches well. A broader match would silently turn caching off for it.I also updated the known limitations section of the README to name both models and both error messages, and noted that kimi-k3 arrived after the payload-diff test run.
Reproduced on pi with
opencode-go/kimi-k3selected. Every request fails until the model is added to the skip list, and every request succeeds afterwards.