Skip to content

Commit b1bc085

Browse files
roomote[bot]roomotedaniel-lxsmrubens
authored
Add todo list tool enable checkbox to provider advanced settings (#6032)
Co-authored-by: Roo Code <[email protected]> Co-authored-by: Daniel Riccio <[email protected]> Co-authored-by: Matt Rubens <[email protected]>
1 parent 7e34fbc commit b1bc085

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+402
-5
lines changed

packages/types/src/provider-settings.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ export const DEFAULT_CONSECUTIVE_MISTAKE_LIMIT = 3
6161
const baseProviderSettingsSchema = z.object({
6262
includeMaxTokens: z.boolean().optional(),
6363
diffEnabled: z.boolean().optional(),
64+
todoListEnabled: z.boolean().optional(),
6465
fuzzyMatchThreshold: z.number().optional(),
6566
modelTemperature: z.number().nullish(),
6667
rateLimitSeconds: z.number().optional(),

src/core/config/ProviderSettingsManager.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ export const providerProfilesSchema = z.object({
2828
diffSettingsMigrated: z.boolean().optional(),
2929
openAiHeadersMigrated: z.boolean().optional(),
3030
consecutiveMistakeLimitMigrated: z.boolean().optional(),
31+
todoListEnabledMigrated: z.boolean().optional(),
3132
})
3233
.optional(),
3334
})
@@ -51,6 +52,7 @@ export class ProviderSettingsManager {
5152
diffSettingsMigrated: true, // Mark as migrated on fresh installs
5253
openAiHeadersMigrated: true, // Mark as migrated on fresh installs
5354
consecutiveMistakeLimitMigrated: true, // Mark as migrated on fresh installs
55+
todoListEnabledMigrated: true, // Mark as migrated on fresh installs
5456
},
5557
}
5658

@@ -117,6 +119,7 @@ export class ProviderSettingsManager {
117119
diffSettingsMigrated: false,
118120
openAiHeadersMigrated: false,
119121
consecutiveMistakeLimitMigrated: false,
122+
todoListEnabledMigrated: false,
120123
} // Initialize with default values
121124
isDirty = true
122125
}
@@ -145,6 +148,12 @@ export class ProviderSettingsManager {
145148
isDirty = true
146149
}
147150

151+
if (!providerProfiles.migrations.todoListEnabledMigrated) {
152+
await this.migrateTodoListEnabled(providerProfiles)
153+
providerProfiles.migrations.todoListEnabledMigrated = true
154+
isDirty = true
155+
}
156+
148157
if (isDirty) {
149158
await this.store(providerProfiles)
150159
}
@@ -250,6 +259,18 @@ export class ProviderSettingsManager {
250259
}
251260
}
252261

262+
private async migrateTodoListEnabled(providerProfiles: ProviderProfiles) {
263+
try {
264+
for (const [_name, apiConfig] of Object.entries(providerProfiles.apiConfigs)) {
265+
if (apiConfig.todoListEnabled === undefined) {
266+
apiConfig.todoListEnabled = true
267+
}
268+
}
269+
} catch (error) {
270+
console.error(`[MigrateTodoListEnabled] Failed to migrate todo list enabled setting:`, error)
271+
}
272+
}
273+
253274
/**
254275
* List all available configs with metadata.
255276
*/

src/core/config/__tests__/ProviderSettingsManager.spec.ts

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ describe("ProviderSettingsManager", () => {
6767
diffSettingsMigrated: true,
6868
openAiHeadersMigrated: true,
6969
consecutiveMistakeLimitMigrated: true,
70+
todoListEnabledMigrated: true,
7071
},
7172
}),
7273
)
@@ -186,6 +187,48 @@ describe("ProviderSettingsManager", () => {
186187
expect(storedConfig.migrations.consecutiveMistakeLimitMigrated).toEqual(true)
187188
})
188189

190+
it("should call migrateTodoListEnabled if it has not done so already", async () => {
191+
mockSecrets.get.mockResolvedValue(
192+
JSON.stringify({
193+
currentApiConfigName: "default",
194+
apiConfigs: {
195+
default: {
196+
config: {},
197+
id: "default",
198+
todoListEnabled: undefined,
199+
},
200+
test: {
201+
apiProvider: "anthropic",
202+
todoListEnabled: undefined,
203+
},
204+
existing: {
205+
apiProvider: "anthropic",
206+
// this should not really be possible, unless someone has loaded a hand edited config,
207+
// but we don't overwrite so we'll check that
208+
todoListEnabled: false,
209+
},
210+
},
211+
migrations: {
212+
rateLimitSecondsMigrated: true,
213+
diffSettingsMigrated: true,
214+
openAiHeadersMigrated: true,
215+
consecutiveMistakeLimitMigrated: true,
216+
todoListEnabledMigrated: false,
217+
},
218+
}),
219+
)
220+
221+
await providerSettingsManager.initialize()
222+
223+
// Get the last call to store, which should contain the migrated config
224+
const calls = mockSecrets.store.mock.calls
225+
const storedConfig = JSON.parse(calls[calls.length - 1][1])
226+
expect(storedConfig.apiConfigs.default.todoListEnabled).toEqual(true)
227+
expect(storedConfig.apiConfigs.test.todoListEnabled).toEqual(true)
228+
expect(storedConfig.apiConfigs.existing.todoListEnabled).toEqual(false)
229+
expect(storedConfig.migrations.todoListEnabledMigrated).toEqual(true)
230+
})
231+
189232
it("should throw error if secrets storage fails", async () => {
190233
mockSecrets.get.mockRejectedValue(new Error("Storage failed"))
191234

src/core/prompts/__tests__/__snapshots__/add-custom-instructions/architect-mode-prompt.snap

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/core/prompts/__tests__/__snapshots__/add-custom-instructions/mcp-server-creation-disabled.snap

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/core/prompts/__tests__/__snapshots__/add-custom-instructions/mcp-server-creation-enabled.snap

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/core/prompts/__tests__/__snapshots__/add-custom-instructions/partial-reads-enabled.snap

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/core/prompts/__tests__/__snapshots__/system-prompt/consistent-system-prompt.snap

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/core/prompts/__tests__/__snapshots__/system-prompt/with-computer-use-support.snap

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/core/prompts/__tests__/__snapshots__/system-prompt/with-diff-enabled-false.snap

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)