Skip to content

Commit f778acf

Browse files
committed
PR fixes
1 parent 2dc3b1a commit f778acf

File tree

20 files changed

+121
-8
lines changed

20 files changed

+121
-8
lines changed

src/core/tools/__tests__/attemptCompletionTool.spec.ts

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -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,

src/i18n/locales/ca/common.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,5 +166,10 @@
166166
"descriptionNoRules": "Esteu segur que voleu suprimir aquest mode personalitzat?",
167167
"confirm": "Suprimeix"
168168
}
169+
},
170+
"commands": {
171+
"preventCompletionWithOpenTodos": {
172+
"description": "Evitar la finalització de tasques quan hi ha todos incomplets a la llista de todos"
173+
}
169174
}
170175
}

src/i18n/locales/de/common.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,5 +166,10 @@
166166
"descriptionNoRules": "Bist du sicher, dass du diesen benutzerdefinierten Modus löschen möchtest?",
167167
"confirm": "Löschen"
168168
}
169+
},
170+
"commands": {
171+
"preventCompletionWithOpenTodos": {
172+
"description": "Aufgabenabschluss verhindern, wenn unvollständige Todos in der Todo-Liste vorhanden sind"
173+
}
169174
}
170175
}

src/i18n/locales/en/common.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,5 +155,10 @@
155155
"descriptionNoRules": "Are you sure you want to delete this custom mode?",
156156
"confirm": "Delete"
157157
}
158+
},
159+
"commands": {
160+
"preventCompletionWithOpenTodos": {
161+
"description": "Prevent task completion when there are incomplete todos in the todo list"
162+
}
158163
}
159164
}

src/i18n/locales/es/common.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,5 +166,10 @@
166166
"descriptionNoRules": "¿Estás seguro de que quieres eliminar este modo personalizado?",
167167
"confirm": "Eliminar"
168168
}
169+
},
170+
"commands": {
171+
"preventCompletionWithOpenTodos": {
172+
"description": "Prevenir la finalización de tareas cuando hay todos incompletos en la lista de todos"
173+
}
169174
}
170175
}

src/i18n/locales/fr/common.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,5 +166,10 @@
166166
"descriptionNoRules": "Êtes-vous sûr de vouloir supprimer ce mode personnalisé ?",
167167
"confirm": "Supprimer"
168168
}
169+
},
170+
"commands": {
171+
"preventCompletionWithOpenTodos": {
172+
"description": "Empêcher la finalisation des tâches lorsqu'il y a des todos incomplets dans la liste de todos"
173+
}
169174
}
170175
}

src/i18n/locales/hi/common.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,5 +166,10 @@
166166
"descriptionNoRules": "क्या आप वाकई इस कस्टम मोड को हटाना चाहते हैं?",
167167
"confirm": "हटाएं"
168168
}
169+
},
170+
"commands": {
171+
"preventCompletionWithOpenTodos": {
172+
"description": "जब टूडू सूची में अधूरे टूडू हों तो कार्य पूर्ण होने से रोकें"
173+
}
169174
}
170175
}

src/i18n/locales/id/common.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,5 +166,10 @@
166166
"descriptionNoRules": "Anda yakin ingin menghapus mode kustom ini?",
167167
"confirm": "Hapus"
168168
}
169+
},
170+
"commands": {
171+
"preventCompletionWithOpenTodos": {
172+
"description": "Mencegah penyelesaian tugas ketika ada todo yang belum selesai dalam daftar todo"
173+
}
169174
}
170175
}

src/i18n/locales/it/common.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,5 +166,10 @@
166166
"descriptionNoRules": "Sei sicuro di voler eliminare questa modalità personalizzata?",
167167
"confirm": "Elimina"
168168
}
169+
},
170+
"commands": {
171+
"preventCompletionWithOpenTodos": {
172+
"description": "Impedire il completamento delle attività quando ci sono todo incompleti nella lista dei todo"
173+
}
169174
}
170175
}

src/i18n/locales/ja/common.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,5 +166,10 @@
166166
"descriptionNoRules": "このカスタムモードを削除してもよろしいですか?",
167167
"confirm": "削除"
168168
}
169+
},
170+
"commands": {
171+
"preventCompletionWithOpenTodos": {
172+
"description": "Todoリストに未完了のTodoがある場合、タスクの完了を防ぐ"
173+
}
169174
}
170175
}

0 commit comments

Comments
 (0)