Skip to content

Commit 201d671

Browse files
committed
Fix redundant 'TASK RESUMPTION' prompts
1 parent f1c7975 commit 201d671

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/core/Cline.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -845,8 +845,15 @@ export class Cline extends EventEmitter<ClineEvents> {
845845
return "just now"
846846
})()
847847

848-
const wasRecent = lastClineMessage?.ts && Date.now() - lastClineMessage.ts < 30_000
848+
const lastTaskResumptionIndex = newUserContent.findIndex(
849+
(x) => x.type === "text" && x.text.startsWith("[TASK RESUMPTION]"),
850+
)
851+
if (lastTaskResumptionIndex !== -1) {
852+
newUserContent.splice(lastTaskResumptionIndex, newUserContent.length - lastTaskResumptionIndex)
853+
}
849854

855+
const wasRecent = lastClineMessage?.ts && Date.now() - lastClineMessage.ts < 30_000
856+
850857
newUserContent.push({
851858
type: "text",
852859
text:

0 commit comments

Comments
 (0)