feat(vscode): implement migration to clear legacy auto-set API URLs in configuration

This commit is contained in:
Bohdan Triapitsyn
2025-12-28 02:30:45 +02:00
parent 0fefc1b301
commit 5b24345013
2 changed files with 7 additions and 0 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 569 KiB

After

Width:  |  Height:  |  Size: 385 KiB

+7
View File
@@ -26,6 +26,13 @@ const formatDurationMs = (value: number | null | undefined) => {
export async function activate(context: vscode.ExtensionContext) {
outputChannel = vscode.window.createOutputChannel('OpenChamber');
// Migration: clear legacy auto-set API URLs (ports 47680-47689 were auto-assigned by older extension versions)
const config = vscode.workspace.getConfiguration('openchamber');
const legacyApiUrl = config.get<string>('apiUrl') || '';
if (/^https?:\/\/localhost:4768\d\/?$/.test(legacyApiUrl.trim())) {
await config.update('apiUrl', '', vscode.ConfigurationTarget.Global);
}
// Create OpenCode manager first
openCodeManager = createOpenCodeManager(context);