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
29 changes: 29 additions & 0 deletions src/core/environment/__tests__/getEnvironmentDetails.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
})
})
6 changes: 5 additions & 1 deletion src/core/environment/getEnvironmentDetails.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<environment_details>\n${details.trim()}\n${reminderSection}\n</environment_details>`
}