@@ -1284,6 +1284,68 @@ describe("applyExtraParamsToAgent", () => {
12841284 expect ( payload ) . not . toHaveProperty ( "store" ) ;
12851285 } ) ;
12861286
1287+ it ( "applies extra_body tuning-key overrides without warning" , ( ) => {
1288+ const warnSpy = vi . spyOn ( log , "warn" ) . mockImplementation ( ( ) => { } ) ;
1289+ try {
1290+ const payload = runResponsesPayloadMutationCase ( {
1291+ applyProvider : "deepseek" ,
1292+ applyModelId : "deepseek-chat" ,
1293+ extraParamsOverride : {
1294+ extra_body : {
1295+ thinking : { type : "disabled" } ,
1296+ } ,
1297+ } ,
1298+ model : {
1299+ api : "openai-completions" ,
1300+ provider : "deepseek" ,
1301+ id : "deepseek-chat" ,
1302+ baseUrl : "https://api.deepseek.com/v1" ,
1303+ } as Model < "openai-completions" > ,
1304+ payload : {
1305+ messages : [ ] ,
1306+ model : "deepseek-chat" ,
1307+ thinking : { type : "enabled" } ,
1308+ } ,
1309+ } ) ;
1310+
1311+ expect ( payload . thinking ) . toEqual ( { type : "disabled" } ) ;
1312+ expect ( warnSpy ) . not . toHaveBeenCalled ( ) ;
1313+ } finally {
1314+ warnSpy . mockRestore ( ) ;
1315+ }
1316+ } ) ;
1317+
1318+ it ( "warns when extra_body overrides framework-managed request scaffolding" , ( ) => {
1319+ const warnSpy = vi . spyOn ( log , "warn" ) . mockImplementation ( ( ) => { } ) ;
1320+ try {
1321+ runResponsesPayloadMutationCase ( {
1322+ applyProvider : "deepseek" ,
1323+ applyModelId : "deepseek-chat" ,
1324+ extraParamsOverride : {
1325+ extra_body : {
1326+ model : "rogue-model" ,
1327+ } ,
1328+ } ,
1329+ model : {
1330+ api : "openai-completions" ,
1331+ provider : "deepseek" ,
1332+ id : "deepseek-chat" ,
1333+ baseUrl : "https://api.deepseek.com/v1" ,
1334+ } as Model < "openai-completions" > ,
1335+ payload : {
1336+ messages : [ ] ,
1337+ model : "deepseek-chat" ,
1338+ } ,
1339+ } ) ;
1340+
1341+ expect ( warnSpy ) . toHaveBeenCalledWith (
1342+ expect . stringContaining ( "framework-managed request keys: model" ) ,
1343+ ) ;
1344+ } finally {
1345+ warnSpy . mockRestore ( ) ;
1346+ }
1347+ } ) ;
1348+
12871349 it ( "forwards chat_template_kwargs params as top-level openai-completions payload fields" , ( ) => {
12881350 const payload = runResponsesPayloadMutationCase ( {
12891351 applyProvider : "vllm" ,
0 commit comments