@@ -631,6 +631,7 @@ test("Edit appends an LLM diagnosis when old_string is not found", async () => {
631631 assert . ok ( snippet ) ;
632632
633633 let llmCalls = 0 ;
634+ let llmRequest : Record < string , unknown > | undefined ;
634635 let prompt = "" ;
635636 const editResult = await handleEditTool (
636637 {
@@ -645,6 +646,7 @@ test("Edit appends an LLM diagnosis when old_string is not found", async () => {
645646 completions : {
646647 create : async ( request : { messages ?: Array < { content ?: string } > } ) => {
647648 llmCalls += 1 ;
649+ llmRequest = request ;
648650 prompt = String ( request . messages ?. [ 1 ] ?. content ?? "" ) ;
649651 return {
650652 choices : [
@@ -661,13 +663,17 @@ test("Edit appends an LLM diagnosis when old_string is not found", async () => {
661663 } ,
662664 } as any ,
663665 model : "test-model" ,
664- thinkingEnabled : false ,
666+ thinkingEnabled : true ,
667+ reasoningEffort : "max" ,
665668 } ) ,
666669 } )
667670 ) ;
668671
669672 assert . equal ( editResult . ok , false ) ;
670673 assert . equal ( llmCalls , 1 ) ;
674+ assert . deepEqual ( llmRequest ?. thinking , { type : "enabled" } ) ;
675+ assert . equal ( llmRequest ?. reasoning_effort , "max" ) ;
676+ assert . equal ( "extra_body" in llmRequest ! , false ) ;
671677 assert . equal (
672678 editResult . error ,
673679 "old_string not found in file. The requested function name is computeTotal, but the snippet contains computeSubtotal."
@@ -972,6 +978,7 @@ test("Edit uses LLM correction when straight and curly quotation marks differ",
972978 const sessionId = "quotation-mark-correction" ;
973979 const snippet = await readSnippet ( filePath , sessionId , workspace ) ;
974980 let llmCalls = 0 ;
981+ let llmRequest : Record < string , unknown > | undefined ;
975982 const editResult = await handleEditTool (
976983 {
977984 snippet_id : snippet . id ,
@@ -989,6 +996,7 @@ test("Edit uses LLM correction when straight and curly quotation marks differ",
989996 completions : {
990997 create : async ( request : { messages ?: Array < { content ?: string } > } ) => {
991998 llmCalls += 1 ;
999+ llmRequest = request ;
9921000 assert . match ( String ( request . messages ?. [ 0 ] ?. content ?? "" ) , / t h e o n l y p r o b l e m i s q u o t a t i o n m a r k / ) ;
9931001 return {
9941002 choices : [
@@ -1013,13 +1021,17 @@ test("Edit uses LLM correction when straight and curly quotation marks differ",
10131021 } ,
10141022 } as any ,
10151023 model : "test-model" ,
1016- thinkingEnabled : false ,
1024+ thinkingEnabled : true ,
1025+ reasoningEffort : "max" ,
10171026 } ) ,
10181027 } )
10191028 ) ;
10201029
10211030 assert . equal ( editResult . ok , true ) ;
10221031 assert . equal ( llmCalls , 1 ) ;
1032+ assert . deepEqual ( llmRequest ?. thinking , { type : "enabled" } ) ;
1033+ assert . equal ( llmRequest ?. reasoning_effort , "max" ) ;
1034+ assert . equal ( "extra_body" in llmRequest ! , false ) ;
10231035 assert . equal ( editResult . metadata ?. matched_via , "llm_escape_correction" ) ;
10241036 assert . equal (
10251037 fs . readFileSync ( filePath , "utf8" ) ,
0 commit comments