Error with models not supporting prompt cache
What version of Kimi Code is running?
0.29.1
Which open platform/subscription were you using?
nvidia nim
Which model were you using?
nemotron, minimax
What platform is your computer?
windows, wsl
What issue are you seeing?
This was working fine until the latest update today. I believe Nvidia NIM doesn't support this but I have been using their models for weeks with kimi code. This week's update broke it somehow. Is there a setting I can use to disable it? Thanks.
Model API error 400 Validation: Unsupported parameter(s): prompt_cache_key
What steps can reproduce the bug?
use 3rd party models without prompt_cache support will error
What is the expected behavior?
No response
Additional information
No response
I think there is still something broken somewhere. I upgraded to newest version and while the prompt_cache error is gone, I am still getting 400 errors for all models on Nvidia NIM except gpt-oss-120b which is OpenAI and compatible. I confimed that the other models work with other harness like opencode.
Anyone else having issues with new kimi on Nvidia NIM?
I have the same problem with nearly all Nvidia NIM models and it still persists with v 0.30:
"Error: [provider.api_error] 400 Validation: Unsupported parameter(s): prompt_cache_key"
Until v 0.27 the error is not showing up.
Please fix it!
I'm still stucked at v0.28.1 because that is the last version without this bug. Please fix the bug or I need to move to another coding agent :(
None of the commits have been acceepted. Sadly I will change to Pi Coding Agent. Bye bye Kimi Code!
This issue is still present in v0.39.1 for NVIDIA NIM endpoints.
PR #2761 provides a clean fix with full test coverage and changeset by gating prompt_cache_key behind isOfficialOpenAIBaseUrl(). It is rebased and ready to be merged.
A fix for this issue is available in PR #2761 (fix(agent-core): gate prompt_cache_key behind isOfficialOpenAIBaseUrl for third-party endpoints).
Summary of Fix
- In
packages/agent-core/src/session/provider-manager.ts,prompt_cache_keywas unconditionally injected intogenerationKwargsfor allopenaiandopenai_responsesproviders, causing strict 3rd-party providers (NVIDIA NIM, Azure OpenAI, etc.) to reject requests with400 Validation: Unsupported parameter(s): prompt_cache_key. - PR #2761 ports the
isOfficialOpenAIBaseUrl()guard fromagent-core-v2to legacyagent-core, ensuringprompt_cache_keyis only sent to official OpenAI hostnames (*.api.openai.com) while leaving Kimi API behavior intact. - Includes unit tests and changeset.
Per the updated CONTRIBUTING.md policy for bug fixes, could a maintainer please review and provide an /approve so PR #2761 can be officially considered? Thank you!