diff --git a/src/core/Cline.ts b/src/core/Cline.ts index afc25dab400..e32dca97e79 100644 --- a/src/core/Cline.ts +++ b/src/core/Cline.ts @@ -612,7 +612,7 @@ export class Cline extends EventEmitter { ]) } - async resumePausedTask(lastMessage?: string) { + async resumePausedTask(lastMessage: string) { // release this Cline instance from paused state this.isPaused = false this.emit("taskUnpaused") @@ -620,14 +620,14 @@ export class Cline extends EventEmitter { // fake an answer from the subtask that it has completed running and this is the result of what it has done // add the message to the chat history and to the webview ui try { - await this.say("text", `${lastMessage ?? "Please continue to the next task."}`) + await this.say("subtask_result", lastMessage) await this.addToApiConversationHistory({ role: "user", content: [ { type: "text", - text: `[new_task completed] Result: ${lastMessage ?? "Please continue to the next task."}`, + text: `[new_task completed] Result: ${lastMessage}`, }, ], }) @@ -1495,8 +1495,6 @@ export class Cline extends EventEmitter { // and return control to the parent task to continue running the rest of the sub-tasks const toolMessage = JSON.stringify({ tool: "finishTask", - content: - "Subtask completed! You can review the results and suggest any corrections or next steps. If everything looks good, confirm to return the result to the parent task.", }) return await askApproval("tool", toolMessage) diff --git a/src/core/tools/attemptCompletionTool.ts b/src/core/tools/attemptCompletionTool.ts index 6af96e9154f..437e803d31c 100644 --- a/src/core/tools/attemptCompletionTool.ts +++ b/src/core/tools/attemptCompletionTool.ts @@ -102,7 +102,7 @@ export async function attemptCompletionTool( } // tell the provider to remove the current subtask and resume the previous task in the stack - await cline.providerRef.deref()?.finishSubTask(`Task complete: ${lastMessage?.text}`) + await cline.providerRef.deref()?.finishSubTask(lastMessage?.text ?? "") return } diff --git a/src/core/webview/ClineProvider.ts b/src/core/webview/ClineProvider.ts index 7e4409323d8..df2a45442c3 100644 --- a/src/core/webview/ClineProvider.ts +++ b/src/core/webview/ClineProvider.ts @@ -184,7 +184,7 @@ export class ClineProvider extends EventEmitter implements // remove the current task/cline instance (at the top of the stack), ao this task is finished // and resume the previous task/cline instance (if it exists) // this is used when a sub task is finished and the parent task needs to be resumed - async finishSubTask(lastMessage?: string) { + async finishSubTask(lastMessage: string) { console.log(`[subtasks] finishing subtask ${lastMessage}`) // remove the last cline instance from the stack (this is the finished sub task) await this.removeClineFromStack() diff --git a/src/exports/api.ts b/src/exports/api.ts index 42b4b1d4bf5..a17d657c497 100644 --- a/src/exports/api.ts +++ b/src/exports/api.ts @@ -152,7 +152,7 @@ export class API extends EventEmitter implements RooCodeAPI { } public async clearCurrentTask(lastMessage?: string) { - await this.sidebarProvider.finishSubTask(lastMessage) + await this.sidebarProvider.finishSubTask(lastMessage ?? "") await this.sidebarProvider.postStateToWebview() } diff --git a/src/exports/roo-code.d.ts b/src/exports/roo-code.d.ts index 490324752b6..40939e4e32a 100644 --- a/src/exports/roo-code.d.ts +++ b/src/exports/roo-code.d.ts @@ -384,6 +384,7 @@ type ClineMessage = { | "mcp_server_response" | "new_task_started" | "new_task" + | "subtask_result" | "checkpoint_saved" | "rooignore_error" ) @@ -463,6 +464,7 @@ type RooCodeEvents = { | "mcp_server_response" | "new_task_started" | "new_task" + | "subtask_result" | "checkpoint_saved" | "rooignore_error" ) diff --git a/src/exports/types.ts b/src/exports/types.ts index b4391d986de..64a955554e9 100644 --- a/src/exports/types.ts +++ b/src/exports/types.ts @@ -389,6 +389,7 @@ type ClineMessage = { | "mcp_server_response" | "new_task_started" | "new_task" + | "subtask_result" | "checkpoint_saved" | "rooignore_error" ) @@ -472,6 +473,7 @@ type RooCodeEvents = { | "mcp_server_response" | "new_task_started" | "new_task" + | "subtask_result" | "checkpoint_saved" | "rooignore_error" ) diff --git a/src/schemas/index.ts b/src/schemas/index.ts index ba014026847..d2471882ecc 100644 --- a/src/schemas/index.ts +++ b/src/schemas/index.ts @@ -739,6 +739,7 @@ export const clineSays = [ "mcp_server_response", "new_task_started", "new_task", + "subtask_result", "checkpoint_saved", "rooignore_error", ] as const diff --git a/webview-ui/src/components/chat/ChatRow.tsx b/webview-ui/src/components/chat/ChatRow.tsx index 4c950915ba7..e73086e5dd8 100644 --- a/webview-ui/src/components/chat/ChatRow.tsx +++ b/webview-ui/src/components/chat/ChatRow.tsx @@ -518,7 +518,7 @@ export const ChatRowContent = ({ return ( <>
- {toolIcon("new-file")} + {toolIcon("tasklist")}
-
- {tool.content} +
+
+ + {t("chat:subtasks.newTaskContent")} +
+
+ +
) @@ -536,11 +561,36 @@ export const ChatRowContent = ({ return ( <>
- {toolIcon("checklist")} + {toolIcon("check-all")} {t("chat:subtasks.wantsToFinish")}
-
- {tool.content} +
+
+ + {t("chat:subtasks.completionContent")} +
+
+ +
) @@ -552,6 +602,43 @@ export const ChatRowContent = ({ switch (message.type) { case "say": switch (message.say) { + case "subtask_result": + return ( +
+
+
+ + {t("chat:subtasks.resultContent")} +
+
+ +
+
+
+ ) case "reasoning": return ( {{mode}}:", - "wantsToFinish": "Roo vol finalitzar aquesta subtasca" + "wantsToFinish": "Roo vol finalitzar aquesta subtasca", + "newTaskContent": "Instruccions de la subtasca", + "completionContent": "Subtasca completada", + "resultContent": "Resultats de la subtasca", + "defaultResult": "Si us plau, continua amb la següent tasca.", + "completionInstructions": "Subtasca completada! Pots revisar els resultats i suggerir correccions o següents passos. Si tot sembla correcte, confirma per tornar el resultat a la tasca principal." }, "questions": { "hasQuestion": "Roo té una pregunta:" diff --git a/webview-ui/src/i18n/locales/de/chat.json b/webview-ui/src/i18n/locales/de/chat.json index 5b19c8cca95..0b378f0db56 100644 --- a/webview-ui/src/i18n/locales/de/chat.json +++ b/webview-ui/src/i18n/locales/de/chat.json @@ -144,7 +144,12 @@ }, "subtasks": { "wantsToCreate": "Roo möchte eine neue Teilaufgabe im {{mode}}-Modus erstellen:", - "wantsToFinish": "Roo möchte diese Teilaufgabe abschließen" + "wantsToFinish": "Roo möchte diese Teilaufgabe abschließen", + "newTaskContent": "Teilaufgabenanweisungen", + "completionContent": "Teilaufgabe abgeschlossen", + "resultContent": "Teilaufgabenergebnisse", + "defaultResult": "Bitte fahre mit der nächsten Aufgabe fort.", + "completionInstructions": "Teilaufgabe abgeschlossen! Du kannst die Ergebnisse überprüfen und Korrekturen oder nächste Schritte vorschlagen. Wenn alles gut aussieht, bestätige, um das Ergebnis an die übergeordnete Aufgabe zurückzugeben." }, "questions": { "hasQuestion": "Roo hat eine Frage:" diff --git a/webview-ui/src/i18n/locales/en/chat.json b/webview-ui/src/i18n/locales/en/chat.json index 73f7afd51c2..d29dbd6162b 100644 --- a/webview-ui/src/i18n/locales/en/chat.json +++ b/webview-ui/src/i18n/locales/en/chat.json @@ -142,7 +142,12 @@ }, "subtasks": { "wantsToCreate": "Roo wants to create a new subtask in {{mode}} mode:", - "wantsToFinish": "Roo wants to finish this subtask" + "wantsToFinish": "Roo wants to finish this subtask", + "newTaskContent": "Subtask Instructions", + "completionContent": "Subtask Completed", + "resultContent": "Subtask Results", + "defaultResult": "Please continue to the next task.", + "completionInstructions": "Subtask completed! You can review the results and suggest any corrections or next steps. If everything looks good, confirm to return the result to the parent task." }, "questions": { "hasQuestion": "Roo has a question:" diff --git a/webview-ui/src/i18n/locales/es/chat.json b/webview-ui/src/i18n/locales/es/chat.json index 2181c94d7ba..4d53776d24f 100644 --- a/webview-ui/src/i18n/locales/es/chat.json +++ b/webview-ui/src/i18n/locales/es/chat.json @@ -144,7 +144,12 @@ }, "subtasks": { "wantsToCreate": "Roo quiere crear una nueva subtarea en modo {{mode}}:", - "wantsToFinish": "Roo quiere finalizar esta subtarea" + "wantsToFinish": "Roo quiere finalizar esta subtarea", + "newTaskContent": "Instrucciones de la subtarea", + "completionContent": "Subtarea completada", + "resultContent": "Resultados de la subtarea", + "defaultResult": "Por favor, continúa con la siguiente tarea.", + "completionInstructions": "¡Subtarea completada! Puedes revisar los resultados y sugerir correcciones o próximos pasos. Si todo se ve bien, confirma para devolver el resultado a la tarea principal." }, "questions": { "hasQuestion": "Roo tiene una pregunta:" diff --git a/webview-ui/src/i18n/locales/fr/chat.json b/webview-ui/src/i18n/locales/fr/chat.json index dc42265a3b3..c5771955b4d 100644 --- a/webview-ui/src/i18n/locales/fr/chat.json +++ b/webview-ui/src/i18n/locales/fr/chat.json @@ -144,7 +144,12 @@ }, "subtasks": { "wantsToCreate": "Roo veut créer une nouvelle sous-tâche en mode {{mode}} :", - "wantsToFinish": "Roo veut terminer cette sous-tâche" + "wantsToFinish": "Roo veut terminer cette sous-tâche", + "newTaskContent": "Instructions de la sous-tâche", + "completionContent": "Sous-tâche terminée", + "resultContent": "Résultats de la sous-tâche", + "defaultResult": "Veuillez continuer avec la tâche suivante.", + "completionInstructions": "Sous-tâche terminée ! Vous pouvez examiner les résultats et suggérer des corrections ou les prochaines étapes. Si tout semble bon, confirmez pour retourner le résultat à la tâche parente." }, "questions": { "hasQuestion": "Roo a une question :" diff --git a/webview-ui/src/i18n/locales/hi/chat.json b/webview-ui/src/i18n/locales/hi/chat.json index e4cadd005e3..a044bf7e21e 100644 --- a/webview-ui/src/i18n/locales/hi/chat.json +++ b/webview-ui/src/i18n/locales/hi/chat.json @@ -144,7 +144,12 @@ }, "subtasks": { "wantsToCreate": "Roo {{mode}} मोड में एक नया उपकार्य बनाना चाहता है:", - "wantsToFinish": "Roo इस उपकार्य को समाप्त करना चाहता है" + "wantsToFinish": "Roo इस उपकार्य को समाप्त करना चाहता है", + "newTaskContent": "उपकार्य निर्देश", + "completionContent": "उपकार्य पूर्ण", + "resultContent": "उपकार्य परिणाम", + "defaultResult": "कृपया अगले कार्य पर जारी रखें।", + "completionInstructions": "उपकार्य पूर्ण! आप परिणामों की समीक्षा कर सकते हैं और सुधार या अगले चरण सुझा सकते हैं। यदि सब कुछ ठीक लगता है, तो मुख्य कार्य को परिणाम वापस करने के लिए पुष्टि करें।" }, "questions": { "hasQuestion": "Roo का एक प्रश्न है:" diff --git a/webview-ui/src/i18n/locales/it/chat.json b/webview-ui/src/i18n/locales/it/chat.json index cd7b7c268ca..03c22b76431 100644 --- a/webview-ui/src/i18n/locales/it/chat.json +++ b/webview-ui/src/i18n/locales/it/chat.json @@ -144,7 +144,12 @@ }, "subtasks": { "wantsToCreate": "Roo vuole creare una nuova sottoattività in modalità {{mode}}:", - "wantsToFinish": "Roo vuole completare questa sottoattività" + "wantsToFinish": "Roo vuole completare questa sottoattività", + "newTaskContent": "Istruzioni sottoattività", + "completionContent": "Sottoattività completata", + "resultContent": "Risultati sottoattività", + "defaultResult": "Per favore continua con la prossima attività.", + "completionInstructions": "Sottoattività completata! Puoi rivedere i risultati e suggerire correzioni o prossimi passi. Se tutto sembra a posto, conferma per restituire il risultato all'attività principale." }, "questions": { "hasQuestion": "Roo ha una domanda:" diff --git a/webview-ui/src/i18n/locales/ja/chat.json b/webview-ui/src/i18n/locales/ja/chat.json index e4be11617ce..b817edfae78 100644 --- a/webview-ui/src/i18n/locales/ja/chat.json +++ b/webview-ui/src/i18n/locales/ja/chat.json @@ -144,7 +144,12 @@ }, "subtasks": { "wantsToCreate": "Rooは{{mode}}モードで新しいサブタスクを作成したい:", - "wantsToFinish": "Rooはこのサブタスクを終了したい" + "wantsToFinish": "Rooはこのサブタスクを終了したい", + "newTaskContent": "サブタスク指示", + "completionContent": "サブタスク完了", + "resultContent": "サブタスク結果", + "defaultResult": "次のタスクに進んでください。", + "completionInstructions": "サブタスク完了!結果を確認し、修正や次のステップを提案できます。問題なければ、親タスクに結果を返すために確認してください。" }, "questions": { "hasQuestion": "Rooは質問があります:" diff --git a/webview-ui/src/i18n/locales/ko/chat.json b/webview-ui/src/i18n/locales/ko/chat.json index b92c1b6de2e..e7c26d0abc3 100644 --- a/webview-ui/src/i18n/locales/ko/chat.json +++ b/webview-ui/src/i18n/locales/ko/chat.json @@ -144,7 +144,12 @@ }, "subtasks": { "wantsToCreate": "Roo가 {{mode}} 모드에서 새 하위 작업을 만들고 싶어합니다:", - "wantsToFinish": "Roo가 이 하위 작업을 완료하고 싶어합니다" + "wantsToFinish": "Roo가 이 하위 작업을 완료하고 싶어합니다", + "newTaskContent": "하위 작업 지침", + "completionContent": "하위 작업 완료", + "resultContent": "하위 작업 결과", + "defaultResult": "다음 작업을 계속 진행해주세요.", + "completionInstructions": "하위 작업 완료! 결과를 검토하고 수정 사항이나 다음 단계를 제안할 수 있습니다. 모든 것이 괜찮아 보이면, 부모 작업에 결과를 반환하기 위해 확인해주세요." }, "questions": { "hasQuestion": "Roo에게 질문이 있습니다:" diff --git a/webview-ui/src/i18n/locales/pl/chat.json b/webview-ui/src/i18n/locales/pl/chat.json index 1fc9fc81486..cd12f58dca6 100644 --- a/webview-ui/src/i18n/locales/pl/chat.json +++ b/webview-ui/src/i18n/locales/pl/chat.json @@ -144,7 +144,12 @@ }, "subtasks": { "wantsToCreate": "Roo chce utworzyć nowe podzadanie w trybie {{mode}}:", - "wantsToFinish": "Roo chce zakończyć to podzadanie" + "wantsToFinish": "Roo chce zakończyć to podzadanie", + "newTaskContent": "Instrukcje podzadania", + "completionContent": "Podzadanie zakończone", + "resultContent": "Wyniki podzadania", + "defaultResult": "Proszę kontynuować następne zadanie.", + "completionInstructions": "Podzadanie zakończone! Możesz przejrzeć wyniki i zasugerować poprawki lub następne kroki. Jeśli wszystko wygląda dobrze, potwierdź, aby zwrócić wynik do zadania nadrzędnego." }, "questions": { "hasQuestion": "Roo ma pytanie:" diff --git a/webview-ui/src/i18n/locales/pt-BR/chat.json b/webview-ui/src/i18n/locales/pt-BR/chat.json index ec444d3b986..250f32ce7e9 100644 --- a/webview-ui/src/i18n/locales/pt-BR/chat.json +++ b/webview-ui/src/i18n/locales/pt-BR/chat.json @@ -144,7 +144,12 @@ }, "subtasks": { "wantsToCreate": "Roo quer criar uma nova subtarefa no modo {{mode}}:", - "wantsToFinish": "Roo quer finalizar esta subtarefa" + "wantsToFinish": "Roo quer finalizar esta subtarefa", + "newTaskContent": "Instruções da subtarefa", + "completionContent": "Subtarefa concluída", + "resultContent": "Resultados da subtarefa", + "defaultResult": "Por favor, continue com a próxima tarefa.", + "completionInstructions": "Subtarefa concluída! Você pode revisar os resultados e sugerir correções ou próximos passos. Se tudo parecer bom, confirme para retornar o resultado à tarefa principal." }, "questions": { "hasQuestion": "Roo tem uma pergunta:" diff --git a/webview-ui/src/i18n/locales/tr/chat.json b/webview-ui/src/i18n/locales/tr/chat.json index 6cd7de384d9..34fc5929909 100644 --- a/webview-ui/src/i18n/locales/tr/chat.json +++ b/webview-ui/src/i18n/locales/tr/chat.json @@ -144,7 +144,12 @@ }, "subtasks": { "wantsToCreate": "Roo {{mode}} modunda yeni bir alt görev oluşturmak istiyor:", - "wantsToFinish": "Roo bu alt görevi bitirmek istiyor" + "wantsToFinish": "Roo bu alt görevi bitirmek istiyor", + "newTaskContent": "Alt Görev Talimatları", + "completionContent": "Alt Görev Tamamlandı", + "resultContent": "Alt Görev Sonuçları", + "defaultResult": "Lütfen sonraki göreve devam edin.", + "completionInstructions": "Alt görev tamamlandı! Sonuçları inceleyebilir ve düzeltmeler veya sonraki adımlar önerebilirsiniz. Her şey iyi görünüyorsa, sonucu üst göreve döndürmek için onaylayın." }, "questions": { "hasQuestion": "Roo'nun bir sorusu var:" diff --git a/webview-ui/src/i18n/locales/vi/chat.json b/webview-ui/src/i18n/locales/vi/chat.json index 0cb305133a0..184b4447e74 100644 --- a/webview-ui/src/i18n/locales/vi/chat.json +++ b/webview-ui/src/i18n/locales/vi/chat.json @@ -144,7 +144,12 @@ }, "subtasks": { "wantsToCreate": "Roo muốn tạo một nhiệm vụ phụ mới trong chế độ {{mode}}:", - "wantsToFinish": "Roo muốn hoàn thành nhiệm vụ phụ này" + "wantsToFinish": "Roo muốn hoàn thành nhiệm vụ phụ này", + "newTaskContent": "Hướng dẫn nhiệm vụ phụ", + "completionContent": "Nhiệm vụ phụ đã hoàn thành", + "resultContent": "Kết quả nhiệm vụ phụ", + "defaultResult": "Vui lòng tiếp tục với nhiệm vụ tiếp theo.", + "completionInstructions": "Nhiệm vụ phụ đã hoàn thành! Bạn có thể xem lại kết quả và đề xuất các sửa đổi hoặc bước tiếp theo. Nếu mọi thứ có vẻ tốt, hãy xác nhận để trả kết quả về nhiệm vụ chính." }, "questions": { "hasQuestion": "Roo có một câu hỏi:" diff --git a/webview-ui/src/i18n/locales/zh-CN/chat.json b/webview-ui/src/i18n/locales/zh-CN/chat.json index 7e7ace29ee9..d834fc81b82 100644 --- a/webview-ui/src/i18n/locales/zh-CN/chat.json +++ b/webview-ui/src/i18n/locales/zh-CN/chat.json @@ -144,7 +144,12 @@ }, "subtasks": { "wantsToCreate": "Roo想在{{mode}}模式下创建新子任务:", - "wantsToFinish": "Roo想完成此子任务" + "wantsToFinish": "Roo想完成此子任务", + "newTaskContent": "子任务说明", + "completionContent": "子任务已完成", + "resultContent": "子任务结果", + "defaultResult": "请继续下一个任务。", + "completionInstructions": "子任务已完成!您可以查看结果并提出修改或下一步建议。如果一切正常,请确认以将结果返回给主任务。" }, "questions": { "hasQuestion": "Roo有一个问题:" diff --git a/webview-ui/src/i18n/locales/zh-TW/chat.json b/webview-ui/src/i18n/locales/zh-TW/chat.json index b86ea259c4e..e00a1b6f096 100644 --- a/webview-ui/src/i18n/locales/zh-TW/chat.json +++ b/webview-ui/src/i18n/locales/zh-TW/chat.json @@ -144,7 +144,12 @@ }, "subtasks": { "wantsToCreate": "Roo 想要在 {{mode}} 模式下建立新的子工作:", - "wantsToFinish": "Roo 想要完成此子工作" + "wantsToFinish": "Roo 想要完成此子工作", + "newTaskContent": "子工作指示", + "completionContent": "子工作已完成", + "resultContent": "子工作結果", + "defaultResult": "請繼續下一個工作。", + "completionInstructions": "子工作已完成!您可以檢閱結果並提出修正或下一步建議。如果一切看起來良好,請確認以將結果傳回主工作。" }, "questions": { "hasQuestion": "Roo 有一個問題:"