Skip to content

fix(llm): allow disabling prompt cache key - #2562

Open
lihailong00 wants to merge 1 commit into
MoonshotAI:mainfrom
lihailong00:codex/issue-2534-prompt-cache-key
Open

fix(llm): allow disabling prompt cache key#2562
lihailong00 wants to merge 1 commit into
MoonshotAI:mainfrom
lihailong00:codex/issue-2534-prompt-cache-key

Conversation

@lihailong00

@lihailong00 lihailong00 commented Jul 27, 2026

Copy link
Copy Markdown

Summary

  • add a prompt_cache_key boolean setting to kimi provider configuration
  • omit the session-derived prompt_cache_key request field when the setting is false
  • preserve the current default behavior for managed Kimi providers
  • document the setting in English and Chinese configuration guides

Third-party Kimi-compatible endpoints such as NVIDIA NIM can use:

[providers.nvidia]
type = "kimi"
base_url = "https://integrate.api.nvidia.com/v1"
api_key = "..."
prompt_cache_key = false

Reproduction and verification

A local OpenAI-compatible HTTP endpoint reproduces the reported behavior: before the fix it returns HTTP 400 when the request contains prompt_cache_key. With the new setting disabled, the real request JSON completely omits the field. A second HTTP regression verifies that the default managed Kimi path still sends the session ID.

  • uv run pytest tests/core/test_config.py tests/core/test_create_llm.py -q — 53 passed
  • targeted Ruff — passed
  • targeted Pyright — 0 errors
  • targeted Ty — passed
  • git diff --check — passed

Closes #2534


Open in Devin Review

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 1 additional finding.

Open in Devin Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Model API error 400 Validation: Unsupported parameter(s): prompt_cache_key

1 participant