fix(coding): recover provider context failures

This commit is contained in:
2026-08-26 14:42:01 +08:00
parent 9f05e2d7e1
commit a09826676e
8 changed files with 349 additions and 9 deletions

View File

@@ -443,13 +443,13 @@ export class CodingConversationService {
try {
selected = await this.runtime.validateModel(model);
} catch (error) { runtimeError(error); }
await this.ensurePrepared(conversationId);
let snapshot: ConversationSnapshot;
try {
snapshot = await this.runtime.getSnapshot(conversationId);
} catch (error) { runtimeError(error); }
this.assertSnapshotAllowsMutation(snapshot);
if (conversation.modelResolution === 'resolved' && conversation.model) {
await this.ensurePrepared(conversationId);
let snapshot: ConversationSnapshot;
try {
snapshot = await this.runtime.getSnapshot(conversationId);
} catch (error) { runtimeError(error); }
this.assertSnapshotAllowsMutation(snapshot);
let state: ConversationModelState;
try {
state = await this.runtime.setModel({