Skip to content

Commit 0d234e7

Browse files
author
Eric Wheeler
committed
fix: Remove misleading task resumption message
This commit removes the misleading [TASK RESUMPTION] message that appears when a task is interrupted. The message was confusing the model and triggering unnecessary re-reads by suggesting things had changed when they hadn't. <environment_details> will always be provided fresh with any necessary information, so the model should assume tasks are up to date. Fixes: #5850 Signed-off-by: Eric Wheeler <roo-code@z.ewheeler.org>
1 parent 2f4d833 commit 0d234e7

File tree

1 file changed

+3
-18
lines changed

1 file changed

+3
-18
lines changed

src/core/task/Task.ts

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -987,26 +987,11 @@ export class Task extends EventEmitter<ClineEvents> {
987987
return "just now"
988988
})()
989989

990-
const lastTaskResumptionIndex = newUserContent.findIndex(
991-
(x) => x.type === "text" && x.text.startsWith("[TASK RESUMPTION]"),
992-
)
993-
if (lastTaskResumptionIndex !== -1) {
994-
newUserContent.splice(lastTaskResumptionIndex, newUserContent.length - lastTaskResumptionIndex)
995-
}
996-
997-
const wasRecent = lastClineMessage?.ts && Date.now() - lastClineMessage.ts < 30_000
998-
999990
newUserContent.push({
1000991
type: "text",
1001-
text:
1002-
`[TASK RESUMPTION] This task was interrupted ${agoText}. It may or may not be complete, so please reassess the task context. Be aware that the project state may have changed since then. If the task has not been completed, retry the last step before interruption and proceed with completing the task.\n\nNote: If you previously attempted a tool use that the user did not provide a result for, you should assume the tool use was not successful and assess whether you should retry. If the last tool was a browser_action, the browser has been closed and you must launch a new browser if needed.${
1003-
wasRecent
1004-
? "\n\nIMPORTANT: If the last tool use was a write_to_file that was interrupted, the file was reverted back to its original state before the interrupted edit, and you do NOT need to re-read the file as you already have its up-to-date contents."
1005-
: ""
1006-
}` +
1007-
(responseText
1008-
? `\n\nNew instructions for task continuation:\n<user_message>\n${responseText}\n</user_message>`
1009-
: ""),
992+
text: responseText
993+
? `\n\nNew instructions for task continuation:\n<user_message>\n${responseText}\n</user_message>`
994+
: "",
1010995
})
1011996

1012997
if (responseImages && responseImages.length > 0) {

0 commit comments

Comments
 (0)