kimi-code icon indicating copy to clipboard operation
kimi-code copied to clipboard

Error with models not supporting prompt cache

Open dewrama opened this issue 4 months ago • 6 comments

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

dewrama avatar Jul 25 '26 01:07 dewrama

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?

dewrama avatar Jul 27 '26 22:07 dewrama

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!

wpauli3000 avatar Jul 29 '26 05:07 wpauli3000

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 :(

wpauli3000 avatar Aug 22 '26 05:08 wpauli3000

None of the commits have been acceepted. Sadly I will change to Pi Coding Agent. Bye bye Kimi Code!

wpauli3000 avatar Aug 27 '26 03:08 wpauli3000

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.

creatiVision avatar Aug 31 '26 13:08 creatiVision

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_key was unconditionally injected into generationKwargs for all openai and openai_responses providers, causing strict 3rd-party providers (NVIDIA NIM, Azure OpenAI, etc.) to reject requests with 400 Validation: Unsupported parameter(s): prompt_cache_key.
  • PR #2761 ports the isOfficialOpenAIBaseUrl() guard from agent-core-v2 to legacy agent-core, ensuring prompt_cache_key is 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!

creatiVision avatar Sep 01 '26 16:09 creatiVision