Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions src/core/Cline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -612,22 +612,22 @@ export class Cline extends EventEmitter<ClineEvents> {
])
}

async resumePausedTask(lastMessage?: string) {
async resumePausedTask(lastMessage: string) {
// release this Cline instance from paused state
this.isPaused = false
this.emit("taskUnpaused")

// 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}`,
},
],
})
Expand Down Expand Up @@ -1495,8 +1495,6 @@ export class Cline extends EventEmitter<ClineEvents> {
// 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)
Expand Down
2 changes: 1 addition & 1 deletion src/core/tools/attemptCompletionTool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
2 changes: 1 addition & 1 deletion src/core/webview/ClineProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ export class ClineProvider extends EventEmitter<ClineProviderEvents> 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()
Expand Down
2 changes: 1 addition & 1 deletion src/exports/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export class API extends EventEmitter<RooCodeEvents> implements RooCodeAPI {
}

public async clearCurrentTask(lastMessage?: string) {
await this.sidebarProvider.finishSubTask(lastMessage)
await this.sidebarProvider.finishSubTask(lastMessage ?? "")
await this.sidebarProvider.postStateToWebview()
}

Expand Down
2 changes: 2 additions & 0 deletions src/exports/roo-code.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,7 @@ type ClineMessage = {
| "mcp_server_response"
| "new_task_started"
| "new_task"
| "subtask_result"
| "checkpoint_saved"
| "rooignore_error"
)
Expand Down Expand Up @@ -463,6 +464,7 @@ type RooCodeEvents = {
| "mcp_server_response"
| "new_task_started"
| "new_task"
| "subtask_result"
| "checkpoint_saved"
| "rooignore_error"
)
Expand Down
2 changes: 2 additions & 0 deletions src/exports/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,7 @@ type ClineMessage = {
| "mcp_server_response"
| "new_task_started"
| "new_task"
| "subtask_result"
| "checkpoint_saved"
| "rooignore_error"
)
Expand Down Expand Up @@ -472,6 +473,7 @@ type RooCodeEvents = {
| "mcp_server_response"
| "new_task_started"
| "new_task"
| "subtask_result"
| "checkpoint_saved"
| "rooignore_error"
)
Expand Down
1 change: 1 addition & 0 deletions src/schemas/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -739,6 +739,7 @@ export const clineSays = [
"mcp_server_response",
"new_task_started",
"new_task",
"subtask_result",
"checkpoint_saved",
"rooignore_error",
] as const
Expand Down
99 changes: 93 additions & 6 deletions webview-ui/src/components/chat/ChatRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ export const ChatRowContent = ({
return (
<>
<div style={headerStyle}>
{toolIcon("new-file")}
{toolIcon("tasklist")}
<span style={{ fontWeight: "bold" }}>
<Trans
i18nKey="chat:subtasks.wantsToCreate"
Expand All @@ -527,20 +527,70 @@ export const ChatRowContent = ({
/>
</span>
</div>
<div style={{ paddingLeft: "26px", marginTop: "4px" }}>
<code>{tool.content}</code>
<div
style={{
marginTop: "4px",
backgroundColor: "var(--vscode-badge-background)",
border: "1px solid var(--vscode-badge-background)",
borderRadius: "4px 4px 0 0",
overflow: "hidden",
marginBottom: "2px",
}}>
<div
style={{
padding: "9px 10px 9px 14px",
backgroundColor: "var(--vscode-badge-background)",
borderBottom: "1px solid var(--vscode-editorGroup-border)",
fontWeight: "bold",
fontSize: "var(--vscode-font-size)",
color: "var(--vscode-badge-foreground)",
display: "flex",
alignItems: "center",
gap: "6px",
}}>
<span className="codicon codicon-arrow-right"></span>
{t("chat:subtasks.newTaskContent")}
</div>
<div style={{ padding: "12px 16px", backgroundColor: "var(--vscode-editor-background)" }}>
<MarkdownBlock markdown={tool.content} />
</div>
</div>
</>
)
case "finishTask":
return (
<>
<div style={headerStyle}>
{toolIcon("checklist")}
{toolIcon("check-all")}
<span style={{ fontWeight: "bold" }}>{t("chat:subtasks.wantsToFinish")}</span>
</div>
<div style={{ paddingLeft: "26px", marginTop: "4px" }}>
<code>{tool.content}</code>
<div
style={{
marginTop: "4px",
backgroundColor: "var(--vscode-editor-background)",
border: "1px solid var(--vscode-badge-background)",
borderRadius: "4px",
overflow: "hidden",
marginBottom: "8px",
}}>
<div
style={{
padding: "9px 10px 9px 14px",
backgroundColor: "var(--vscode-badge-background)",
borderBottom: "1px solid var(--vscode-editorGroup-border)",
fontWeight: "bold",
fontSize: "var(--vscode-font-size)",
color: "var(--vscode-badge-foreground)",
display: "flex",
alignItems: "center",
gap: "6px",
}}>
<span className="codicon codicon-check"></span>
{t("chat:subtasks.completionContent")}
</div>
<div style={{ padding: "12px 16px", backgroundColor: "var(--vscode-editor-background)" }}>
<MarkdownBlock markdown={t("chat:subtasks.completionInstructions")} />
</div>
</div>
</>
)
Expand All @@ -552,6 +602,43 @@ export const ChatRowContent = ({
switch (message.type) {
case "say":
switch (message.say) {
case "subtask_result":
return (
<div>
<div
style={{
marginTop: "0px",
backgroundColor: "var(--vscode-badge-background)",
border: "1px solid var(--vscode-badge-background)",
borderRadius: "0 0 4px 4px",
overflow: "hidden",
marginBottom: "8px",
}}>
<div
style={{
padding: "9px 10px 9px 14px",
backgroundColor: "var(--vscode-badge-background)",
borderBottom: "1px solid var(--vscode-editorGroup-border)",
fontWeight: "bold",
fontSize: "var(--vscode-font-size)",
color: "var(--vscode-badge-foreground)",
display: "flex",
alignItems: "center",
gap: "6px",
}}>
<span className="codicon codicon-arrow-left"></span>
{t("chat:subtasks.resultContent")}
</div>
<div
style={{
padding: "12px 16px",
backgroundColor: "var(--vscode-editor-background)",
}}>
<MarkdownBlock markdown={message.text} />
</div>
</div>
</div>
)
case "reasoning":
return (
<ReasoningBlock
Expand Down
7 changes: 6 additions & 1 deletion webview-ui/src/i18n/locales/ca/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,12 @@
},
"subtasks": {
"wantsToCreate": "Roo vol crear una nova subtasca en mode <code>{{mode}}</code>:",
"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:"
Expand Down
7 changes: 6 additions & 1 deletion webview-ui/src/i18n/locales/de/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,12 @@
},
"subtasks": {
"wantsToCreate": "Roo möchte eine neue Teilaufgabe im <code>{{mode}}</code>-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:"
Expand Down
7 changes: 6 additions & 1 deletion webview-ui/src/i18n/locales/en/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -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:"
Expand Down
7 changes: 6 additions & 1 deletion webview-ui/src/i18n/locales/es/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,12 @@
},
"subtasks": {
"wantsToCreate": "Roo quiere crear una nueva subtarea en modo <code>{{mode}}</code>:",
"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:"
Expand Down
7 changes: 6 additions & 1 deletion webview-ui/src/i18n/locales/fr/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,12 @@
},
"subtasks": {
"wantsToCreate": "Roo veut créer une nouvelle sous-tâche en mode <code>{{mode}}</code> :",
"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 :"
Expand Down
7 changes: 6 additions & 1 deletion webview-ui/src/i18n/locales/hi/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,12 @@
},
"subtasks": {
"wantsToCreate": "Roo <code>{{mode}}</code> मोड में एक नया उपकार्य बनाना चाहता है:",
"wantsToFinish": "Roo इस उपकार्य को समाप्त करना चाहता है"
"wantsToFinish": "Roo इस उपकार्य को समाप्त करना चाहता है",
"newTaskContent": "उपकार्य निर्देश",
"completionContent": "उपकार्य पूर्ण",
"resultContent": "उपकार्य परिणाम",
"defaultResult": "कृपया अगले कार्य पर जारी रखें।",
"completionInstructions": "उपकार्य पूर्ण! आप परिणामों की समीक्षा कर सकते हैं और सुधार या अगले चरण सुझा सकते हैं। यदि सब कुछ ठीक लगता है, तो मुख्य कार्य को परिणाम वापस करने के लिए पुष्टि करें।"
},
"questions": {
"hasQuestion": "Roo का एक प्रश्न है:"
Expand Down
7 changes: 6 additions & 1 deletion webview-ui/src/i18n/locales/it/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,12 @@
},
"subtasks": {
"wantsToCreate": "Roo vuole creare una nuova sottoattività in modalità <code>{{mode}}</code>:",
"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:"
Expand Down
7 changes: 6 additions & 1 deletion webview-ui/src/i18n/locales/ja/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,12 @@
},
"subtasks": {
"wantsToCreate": "Rooは<code>{{mode}}</code>モードで新しいサブタスクを作成したい:",
"wantsToFinish": "Rooはこのサブタスクを終了したい"
"wantsToFinish": "Rooはこのサブタスクを終了したい",
"newTaskContent": "サブタスク指示",
"completionContent": "サブタスク完了",
"resultContent": "サブタスク結果",
"defaultResult": "次のタスクに進んでください。",
"completionInstructions": "サブタスク完了!結果を確認し、修正や次のステップを提案できます。問題なければ、親タスクに結果を返すために確認してください。"
},
"questions": {
"hasQuestion": "Rooは質問があります:"
Expand Down
7 changes: 6 additions & 1 deletion webview-ui/src/i18n/locales/ko/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,12 @@
},
"subtasks": {
"wantsToCreate": "Roo가 <code>{{mode}}</code> 모드에서 새 하위 작업을 만들고 싶어합니다:",
"wantsToFinish": "Roo가 이 하위 작업을 완료하고 싶어합니다"
"wantsToFinish": "Roo가 이 하위 작업을 완료하고 싶어합니다",
"newTaskContent": "하위 작업 지침",
"completionContent": "하위 작업 완료",
"resultContent": "하위 작업 결과",
"defaultResult": "다음 작업을 계속 진행해주세요.",
"completionInstructions": "하위 작업 완료! 결과를 검토하고 수정 사항이나 다음 단계를 제안할 수 있습니다. 모든 것이 괜찮아 보이면, 부모 작업에 결과를 반환하기 위해 확인해주세요."
},
"questions": {
"hasQuestion": "Roo에게 질문이 있습니다:"
Expand Down
7 changes: 6 additions & 1 deletion webview-ui/src/i18n/locales/pl/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,12 @@
},
"subtasks": {
"wantsToCreate": "Roo chce utworzyć nowe podzadanie w trybie <code>{{mode}}</code>:",
"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:"
Expand Down
7 changes: 6 additions & 1 deletion webview-ui/src/i18n/locales/pt-BR/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,12 @@
},
"subtasks": {
"wantsToCreate": "Roo quer criar uma nova subtarefa no modo <code>{{mode}}</code>:",
"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:"
Expand Down
7 changes: 6 additions & 1 deletion webview-ui/src/i18n/locales/tr/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,12 @@
},
"subtasks": {
"wantsToCreate": "Roo <code>{{mode}}</code> 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:"
Expand Down
Loading