3234
3235
private async _storeSessionMetadata(session: URI, model: ModelSelection | undefined, workingDirectory: URI | undefined, customizationDirectory: URI | undefined, project: IAgentSessionProjectInfo | undefined, projectResolved = project !== undefined): Promise<void> {
3236
>
const dbRef = this._sessionDataService.openDatabase(session);
copilotAgent.ts
3237
>
const db = dbRef.object;
3238
>
try {
3239
>
const work: Promise<void>[] = [];
3240
>
if (model) {
3241
work.push(db.setMetadata(CopilotAgent._META_MODEL, this._serializeModelSelection(model)));
3242
}
3244
work.push(db.setMetadata(CopilotAgent._META_CWD, workingDirectory.toString()));
3245
}
3247
work.push(db.setMetadata(CopilotAgent._META_CUSTOMIZATION_DIRECTORY, customizationDirectory.toString()));
3248
}
3250
>
work.push(db.setMetadata(CopilotAgent._META_PROJECT_RESOLVED, 'true'));
3251
>
}
3252
>
if (project) {
3253
work.push(db.setMetadata(CopilotAgent._META_PROJECT_URI, project.uri.toString()));
3254
work.push(db.setMetadata(CopilotAgent._META_PROJECT_DISPLAY_NAME, project.displayName));
3255
}
3257
>
} finally {
3258
>
dbRef.dispose();
3259
>
}
3260
>
}
3261
3262
private async _readSessionMetadata(session: URI): Promise<{ model?: ModelSelection; agent?: AgentSelection; workingDirectory?: URI; customizationDirectory?: URI; workspaceless?: boolean }> {