Repository navigation
fix(agent-core-v2): only send prompt_cache_key to official OpenAI endpoints - #3660
Closed
creatiVision wants to merge 1 commit into
Closed
creatiVision wants to merge 1 commit into
creatiVision wants to merge 1 commit into
Conversation
🦋 Changeset detectedLatest commit: 0c0ae57 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
This was referenced Sep 8, 2026
Author
|
Superseded by #2240 — the same reconciled fix lives on |
1 similar comment
Author
|
Superseded by #2240 — the same reconciled fix lives on |
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.
Related Issue
Resolves #2166 (NVIDIA NIM:
400 Validation: Unsupported parameter(s): prompt_cache_key). Related: #2611 (Azure Foundry:400 Unrecognized request argument supplied: prompt_cache_key).Supersedes and replaces #2240 and #2761, which are closed in favor of this single reconciled branch.
Problem
Since v0.29.0 (#1970), every OpenAI-compatible provider receives the session
prompt_cache_keyin the request body. Strictly-validating endpoints (e.g. NVIDIA NIM, Azure Foundry) reject the unknown parameter with HTTP 400, making customopenai/openai_responsesproviders unusable for agent sessions.What changed
The field is now only sent when the effective base URL targets the official OpenAI API (
api.openai.comor a regional*.api.openai.comvariant, or unset → client default):isOfficialOpenAIBaseUrl()helper inpackages/agent-core-v2/src/human/llm/requester/bases/openai-base-url.ts.prompt_cache_keyfallback behind it in both the OpenAI chat-completions and Responses bases (openai/format.ts,openai-responses/format.ts). A vendor that supports the field on other hosts keeps encoding it via thecacheKeytrait hook (e.g. Kimi), which is unaffected.cache-key.test.ts(official endpoint keeps the key; third-party endpoint omits it) andresponse-format.test.ts(Responses base omits it for third-party endpoints).Checklist
/approve).gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.