fix(openai): strip unsupported ChatGPT prompt cache retention options while preserving prompt cache keys

This commit is contained in:
2026-05-14 19:59:30 +00:00
parent 0e2053f538
commit 4725b55566
3 changed files with 34 additions and 10 deletions
+8
View File
@@ -203,6 +203,12 @@ tap.test('getModel uses ChatGPT Codex backend for OpenAI ChatGPT auth', async ()
model,
system: 'system prompt',
prompt: 'hello',
providerOptions: {
openai: {
promptCacheKey: 'session-1',
promptCacheRetention: 'in_memory',
},
},
});
expect(capturedRequest?.url).toEqual('https://chatgpt.com/backend-api/codex/responses');
@@ -214,6 +220,8 @@ tap.test('getModel uses ChatGPT Codex backend for OpenAI ChatGPT auth', async ()
expect(capturedBody.input).toEqual([
{ role: 'user', content: [{ type: 'input_text', text: 'hello' }] },
]);
expect(capturedBody.prompt_cache_key).toEqual('session-1');
expect(capturedBody.prompt_cache_retention).toEqual(undefined);
} finally {
globalThis.fetch = originalFetch;
}