fix(alicode): preserve cache_control for DashScope providers (#2069)
Opt-in quirk preserveCacheControl keeps cache_control on content blocks for alicode/alicode-intl, enabling DashScope prompt caching. signature is always stripped; all other providers unchanged. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -109,7 +109,9 @@ export function translateRequest(sourceFormat, targetFormat, model, body, stream
|
||||
// Always normalize to clean OpenAI format when target is OpenAI
|
||||
// This handles hybrid requests (e.g., OpenAI messages + Claude tools)
|
||||
if (targetFormat === FORMATS.OPENAI) {
|
||||
result = filterToOpenAIFormat(result);
|
||||
result = filterToOpenAIFormat(result, {
|
||||
preserveCacheControl: !!PROVIDERS[provider]?.quirks?.preserveCacheControl,
|
||||
});
|
||||
}
|
||||
|
||||
// Final step: prepare request for Claude format endpoints
|
||||
|
||||
Reference in New Issue
Block a user