@@ -822,6 +822,57 @@ describe("OpenAI Responses passthrough sanitization", () => {
822822 expect ( body . prompt_cache_retention ) . toBe ( "24h" ) ;
823823 } ) ;
824824
825+ test . each ( [
826+ "gpt-5.6" ,
827+ "gpt-5.6-sol" ,
828+ "gpt-5.6-terra" ,
829+ "gpt-5.6-luna" ,
830+ ] ) ( "drops deprecated prompt_cache_retention for %s without inventing replacement options" , modelId => {
831+ const adapter = createResponsesPassthroughAdapter ( provider ) ;
832+ const request = adapter . buildRequest ( {
833+ modelId,
834+ context : { messages : [ ] } ,
835+ stream : true ,
836+ options : { } ,
837+ _rawBody : {
838+ model : modelId ,
839+ input : "hi" ,
840+ prompt_cache_retention : "24h" ,
841+ } ,
842+ } , { headers : new Headers ( { authorization : "Bearer token" } ) } ) ;
843+ const body = JSON . parse ( request . body ) as {
844+ prompt_cache_retention ?: string ;
845+ prompt_cache_options ?: unknown ;
846+ } ;
847+
848+ expect ( body . prompt_cache_retention ) . toBeUndefined ( ) ;
849+ expect ( body . prompt_cache_options ) . toBeUndefined ( ) ;
850+ } ) ;
851+
852+ test ( "preserves caller prompt_cache_options while dropping GPT-5.6 legacy retention" , ( ) => {
853+ const adapter = createResponsesPassthroughAdapter ( provider ) ;
854+ const promptCacheOptions = { mode : "explicit" , ttl : "30m" } ;
855+ const request = adapter . buildRequest ( {
856+ modelId : "gpt-5.6-sol" ,
857+ context : { messages : [ ] } ,
858+ stream : true ,
859+ options : { } ,
860+ _rawBody : {
861+ model : "gpt-5.6-sol" ,
862+ input : "hi" ,
863+ prompt_cache_retention : "24h" ,
864+ prompt_cache_options : promptCacheOptions ,
865+ } ,
866+ } , { headers : new Headers ( { authorization : "Bearer token" } ) } ) ;
867+ const body = JSON . parse ( request . body ) as {
868+ prompt_cache_retention ?: string ;
869+ prompt_cache_options ?: unknown ;
870+ } ;
871+
872+ expect ( body . prompt_cache_retention ) . toBeUndefined ( ) ;
873+ expect ( body . prompt_cache_options ) . toEqual ( promptCacheOptions ) ;
874+ } ) ;
875+
825876 const expandedRawBody = {
826877 model : "gpt-5.5" ,
827878 previous_response_id : "resp_1" ,
0 commit comments