From 5922eef3956399661fa41b329ef16bf4e5cf5feb Mon Sep 17 00:00:00 2001 From: NaccOll Date: Wed, 30 Jul 2025 11:00:42 +0800 Subject: [PATCH 1/2] feat: conditionally include reminder section based on todo list configuration --- src/core/environment/getEnvironmentDetails.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/core/environment/getEnvironmentDetails.ts b/src/core/environment/getEnvironmentDetails.ts index 5a0a15962cd..fbc1f2dc577 100644 --- a/src/core/environment/getEnvironmentDetails.ts +++ b/src/core/environment/getEnvironmentDetails.ts @@ -268,6 +268,10 @@ export async function getEnvironmentDetails(cline: Task, includeFileDetails: boo } } - const reminderSection = formatReminderSection(cline.todoList) + const todoListEnabled = + state && typeof state.apiConfiguration?.todoListEnabled === "boolean" + ? state.apiConfiguration.todoListEnabled + : true + const reminderSection = todoListEnabled ? formatReminderSection(cline.todoList) : "" return `\n${details.trim()}\n${reminderSection}\n` } From 9e82cfc04484179deca933e1372bf65379420be4 Mon Sep 17 00:00:00 2001 From: NaccOll Date: Wed, 30 Jul 2025 11:08:35 +0800 Subject: [PATCH 2/2] feat: add tests for REMINDERS section based on todoListEnabled configuration --- .../__tests__/getEnvironmentDetails.spec.ts | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/core/environment/__tests__/getEnvironmentDetails.spec.ts b/src/core/environment/__tests__/getEnvironmentDetails.spec.ts index a1b8691e703..780feed2f62 100644 --- a/src/core/environment/__tests__/getEnvironmentDetails.spec.ts +++ b/src/core/environment/__tests__/getEnvironmentDetails.spec.ts @@ -361,4 +361,33 @@ describe("getEnvironmentDetails", () => { await expect(getEnvironmentDetails(mockCline as Task)).resolves.not.toThrow() }) + it("should include REMINDERS section when todoListEnabled is true", async () => { + mockProvider.getState.mockResolvedValue({ + ...mockState, + apiConfiguration: { todoListEnabled: true }, + }) + const cline = { ...mockCline, todoList: [{ content: "test", status: "pending" }] } + const result = await getEnvironmentDetails(cline as Task) + expect(result).toContain("REMINDERS") + }) + + it("should NOT include REMINDERS section when todoListEnabled is false", async () => { + mockProvider.getState.mockResolvedValue({ + ...mockState, + apiConfiguration: { todoListEnabled: false }, + }) + const cline = { ...mockCline, todoList: [{ content: "test", status: "pending" }] } + const result = await getEnvironmentDetails(cline as Task) + expect(result).not.toContain("REMINDERS") + }) + + it("should include REMINDERS section when todoListEnabled is undefined", async () => { + mockProvider.getState.mockResolvedValue({ + ...mockState, + apiConfiguration: {}, + }) + const cline = { ...mockCline, todoList: [{ content: "test", status: "pending" }] } + const result = await getEnvironmentDetails(cline as Task) + expect(result).toContain("REMINDERS") + }) })