Update src/extension.ts

Co-authored-by: Seth Miller <sethmillerp@gmail.com>
This commit is contained in:
Hannes Rudolph 2026-01-19 20:15:09 -07:00
parent d1bdbd56b8
commit 06df1ca068

View file

@ -166,38 +166,6 @@ export async function activate(context: vscode.ExtensionContext) {
// Initialize the provider *before* the Roo Code Cloud service so we can reuse its task deletion logic.
const provider = new ClineProvider(context, outputChannel, "sidebar", contextProxy, mdmService)
// Task history retention purge (runs only on activation)
try {
const config = vscode.workspace.getConfiguration(Package.name)
const retention = config.get<string>("taskHistoryRetention", "never") ?? "never"
outputChannel.appendLine(`[Retention] Startup purge: setting=${retention}`)
const result = await purgeOldTasks(
retention as RetentionSetting,
contextProxy.globalStorageUri.fsPath,
(m) => {
outputChannel.appendLine(m)
console.log(m)
},
false,
async (taskId: string, _taskDirPath: string) => {
// Reuse the same internal deletion logic as the History view so that
// checkpoints, shadow repositories, and task state are cleaned up consistently.
await provider.deleteTaskWithId(taskId)
},
)
outputChannel.appendLine(
`[Retention] Startup purge complete: purged=${result.purgedCount}, cutoff=${result.cutoff ?? "none"}`,
)
} catch (error) {
outputChannel.appendLine(
`[Retention] Failed during startup purge: ${error instanceof Error ? error.message : String(error)}`,
)
}
// Initialize code index managers for all workspace folders.
const codeIndexManagers: CodeIndexManager[] = []