121
return;
122
}
124
>
// Update storage root for the new workspace
125
>
this.storageRoot = newStorageRoot;
126
>
127
>
// Migrate session files from old to new location
128
>
await this.migrateSessionsToNewWorkspace(oldStorageRoot, wasEmptyWindow, isNewWorkspaceEmpty);
129
}
130
131
private async migrateSessionsToNewWorkspace(oldStorageRoot: URI, wasEmptyWindow: boolean, isNewWorkspaceEmpty: boolean): Promise<void> {
133
>
// Check if old storage location exists
134
>
const oldStorageExists = await this.fileService.exists(oldStorageRoot);
135
>
if (!oldStorageExists) {
136
this.logService.info(`ChatSessionStore: Old storage location does not exist, skipping migration`);
137
return;
138
}
140
>
// Read all session files from old location
141
>
const oldDirectory = await this.fileService.resolve(oldStorageRoot);
142
>
if (!oldDirectory.children) {
143
>
this.logService.info(`ChatSessionStore: No children in old storage location, skipping migration`);
144
>
return;
145
>
}
146
147
this.logService.info(`ChatSessionStore: Found ${oldDirectory.children.length} files in old storage location`);