@@ -76,13 +76,6 @@ describe("attemptCompletionTool", () => {
7676
7777 mockTask . todoList = undefined
7878
79- // Mock the formatResponse to avoid import issues
80- vi . doMock ( "../../prompts/responses" , ( ) => ( {
81- formatResponse : {
82- toolError : vi . fn ( ( msg ) => `Error: ${ msg } ` ) ,
83- } ,
84- } ) )
85-
8679 await attemptCompletionTool (
8780 mockTask as Task ,
8881 block ,
@@ -169,6 +162,16 @@ describe("attemptCompletionTool", () => {
169162
170163 mockTask . todoList = todosWithPending
171164
165+ // Enable the setting to prevent completion with open todos
166+ mockGetConfiguration . mockReturnValue ( {
167+ get : vi . fn ( ( key : string , defaultValue : any ) => {
168+ if ( key === "preventCompletionWithOpenTodos" ) {
169+ return true // Setting is enabled
170+ }
171+ return defaultValue
172+ } ) ,
173+ } )
174+
172175 await attemptCompletionTool (
173176 mockTask as Task ,
174177 block ,
@@ -202,6 +205,16 @@ describe("attemptCompletionTool", () => {
202205
203206 mockTask . todoList = todosWithInProgress
204207
208+ // Enable the setting to prevent completion with open todos
209+ mockGetConfiguration . mockReturnValue ( {
210+ get : vi . fn ( ( key : string , defaultValue : any ) => {
211+ if ( key === "preventCompletionWithOpenTodos" ) {
212+ return true // Setting is enabled
213+ }
214+ return defaultValue
215+ } ) ,
216+ } )
217+
205218 await attemptCompletionTool (
206219 mockTask as Task ,
207220 block ,
@@ -236,6 +249,16 @@ describe("attemptCompletionTool", () => {
236249
237250 mockTask . todoList = mixedTodos
238251
252+ // Enable the setting to prevent completion with open todos
253+ mockGetConfiguration . mockReturnValue ( {
254+ get : vi . fn ( ( key : string , defaultValue : any ) => {
255+ if ( key === "preventCompletionWithOpenTodos" ) {
256+ return true // Setting is enabled
257+ }
258+ return defaultValue
259+ } ) ,
260+ } )
261+
239262 await attemptCompletionTool (
240263 mockTask as Task ,
241264 block ,
0 commit comments