Skip to content

Commit 1b1af5a

Browse files
committed
fix: improve advanced settings UI and make update_todo_list references conditional
- Fix Advanced Settings toggle UI in CodeIndexPopover by adding proper spacing (gap-2) and removing margin from chevron to prevent text overlay - Make update_todo_list tool references conditional on todoListEnabled setting in reminder.ts and getEnvironmentDetails.ts - Update architect mode instructions to conditionally reference update_todo_list tool based on availability - All tests passing and TypeScript compilation successful Addresses feedback from issue #5624
1 parent 195f4eb commit 1b1af5a

File tree

4 files changed

+17
-11
lines changed

4 files changed

+17
-11
lines changed

packages/types/src/mode.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ export const DEFAULT_MODES: readonly ModeConfig[] = [
144144
description: "Plan and design before implementation",
145145
groups: ["read", ["edit", { fileRegex: "\\.md$", description: "Markdown files only" }], "browser", "mcp"],
146146
customInstructions:
147-
"1. Do some information gathering (using provided tools) to get more context about the task.\n\n2. You should also ask the user clarifying questions to get a better understanding of the task.\n\n3. Once you've gained more context about the user's request, break down the task into clear, actionable steps and create a todo list using the `update_todo_list` tool. Each todo item should be:\n - Specific and actionable\n - Listed in logical execution order\n - Focused on a single, well-defined outcome\n - Clear enough that another mode could execute it independently\n\n **Note:** If the `update_todo_list` tool is not available, write the plan to a markdown file (e.g., `plan.md` or `todo.md`) instead.\n\n4. As you gather more information or discover new requirements, update the todo list to reflect the current understanding of what needs to be accomplished.\n\n5. Ask the user if they are pleased with this plan, or if they would like to make any changes. Think of this as a brainstorming session where you can discuss the task and refine the todo list.\n\n6. Include Mermaid diagrams if they help clarify complex workflows or system architecture. Please avoid using double quotes (\"\") and parentheses () inside square brackets ([]) in Mermaid diagrams, as this can cause parsing errors.\n\n7. Use the switch_mode tool to request that the user switch to another mode to implement the solution.\n\n**IMPORTANT: Focus on creating clear, actionable todo lists rather than lengthy markdown documents. Use the todo list as your primary planning tool to track and organize the work that needs to be done.**",
147+
"1. Do some information gathering (using provided tools) to get more context about the task.\n\n2. You should also ask the user clarifying questions to get a better understanding of the task.\n\n3. Once you've gained more context about the user's request, break down the task into clear, actionable steps. If the `update_todo_list` tool is available, create a todo list using it. If not, write the plan to a markdown file (e.g., `plan.md` or `todo.md`). Each todo item should be:\n - Specific and actionable\n - Listed in logical execution order\n - Focused on a single, well-defined outcome\n - Clear enough that another mode could execute it independently\n\n4. As you gather more information or discover new requirements, update your plan to reflect the current understanding of what needs to be accomplished.\n\n5. Ask the user if they are pleased with this plan, or if they would like to make any changes. Think of this as a brainstorming session where you can discuss the task and refine the plan.\n\n6. Include Mermaid diagrams if they help clarify complex workflows or system architecture. Please avoid using double quotes (\"\") and parentheses () inside square brackets ([]) in Mermaid diagrams, as this can cause parsing errors.\n\n7. Use the switch_mode tool to request that the user switch to another mode to implement the solution.\n\n**IMPORTANT: Focus on creating clear, actionable plans rather than lengthy markdown documents. Use your available planning tools to track and organize the work that needs to be done.**",
148148
},
149149
{
150150
slug: "code",

src/core/environment/getEnvironmentDetails.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,6 @@ export async function getEnvironmentDetails(cline: Task, includeFileDetails: boo
272272
state && typeof state.apiConfiguration?.todoListEnabled === "boolean"
273273
? state.apiConfiguration.todoListEnabled
274274
: true
275-
const reminderSection = todoListEnabled ? formatReminderSection(cline.todoList) : ""
275+
const reminderSection = todoListEnabled ? formatReminderSection(cline.todoList, todoListEnabled) : ""
276276
return `<environment_details>\n${details.trim()}\n${reminderSection}\n</environment_details>`
277277
}

src/core/environment/reminder.ts

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,13 @@ import { TodoItem, TodoStatus } from "@roo-code/types"
33
/**
44
* Format the reminders section as a markdown block in English, with basic instructions.
55
*/
6-
export function formatReminderSection(todoList?: TodoItem[]): string {
6+
export function formatReminderSection(todoList?: TodoItem[], todoListEnabled: boolean = true): string {
77
if (!todoList || todoList.length === 0) {
8-
return "You have not created a todo list yet. Create one with `update_todo_list` if your task is complicated or involves multiple steps."
8+
if (todoListEnabled) {
9+
return "You have not created a todo list yet. Create one with `update_todo_list` if your task is complicated or involves multiple steps."
10+
} else {
11+
return "Todo list functionality is disabled for this provider."
12+
}
913
}
1014
const statusMap: Record<TodoStatus, string> = {
1115
pending: "Pending",
@@ -29,10 +33,12 @@ export function formatReminderSection(todoList?: TodoItem[]): string {
2933
})
3034
lines.push("")
3135

32-
lines.push(
33-
"",
34-
"IMPORTANT: When task status changes, remember to call the `update_todo_list` tool to update your progress.",
35-
"",
36-
)
36+
if (todoListEnabled) {
37+
lines.push(
38+
"",
39+
"IMPORTANT: When task status changes, remember to call the `update_todo_list` tool to update your progress.",
40+
"",
41+
)
42+
}
3743
return lines.join("\n")
3844
}

webview-ui/src/components/chat/CodeIndexPopover.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1187,10 +1187,10 @@ export const CodeIndexPopover: React.FC<CodeIndexPopoverProps> = ({
11871187
<div className="mt-4">
11881188
<button
11891189
onClick={() => setIsAdvancedSettingsOpen(!isAdvancedSettingsOpen)}
1190-
className="flex items-center text-xs text-vscode-foreground hover:text-vscode-textLink-foreground focus:outline-none"
1190+
className="flex items-center gap-2 text-xs text-vscode-foreground hover:text-vscode-textLink-foreground focus:outline-none"
11911191
aria-expanded={isAdvancedSettingsOpen}>
11921192
<span
1193-
className={`codicon codicon-${isAdvancedSettingsOpen ? "chevron-down" : "chevron-right"} mr-1`}></span>
1193+
className={`codicon codicon-${isAdvancedSettingsOpen ? "chevron-down" : "chevron-right"}`}></span>
11941194
<span className="text-base font-semibold">
11951195
{t("settings:codeIndex.advancedConfigLabel")}
11961196
</span>

0 commit comments

Comments
 (0)