fix(pi): keep active runs alive during background sleep

This commit is contained in:
2026-08-25 20:56:17 +08:00
parent 92f4c91088
commit 621ebb1781
22 changed files with 1061 additions and 68 deletions

View File

@@ -335,7 +335,7 @@ export class CodingConversationService {
async deleteConversation(conversationId: string): Promise<void> {
const { project, conversation } = await this.projects.findActiveConversation(conversationId);
try {
await this.runtime.dispose(conversationId);
await this.runtime.dispose(conversationId, 'conversation_deleted');
} catch (error) {
runtimeError(error);
}
@@ -463,7 +463,7 @@ export class CodingConversationService {
const preparing = this.prepareFlights.get(conversationId);
if (preparing) await preparing.catch(() => undefined);
try {
await this.runtime.dispose(conversationId);
await this.runtime.dispose(conversationId, 'model_reconfiguration');
this.prepareFlights.delete(conversationId);
await this.ensurePrepared(conversationId);
return state;
@@ -537,7 +537,7 @@ export class CodingConversationService {
return publicConversation(created);
} catch (error) {
try {
await this.runtime.dispose(created.id);
await this.runtime.dispose(created.id, 'fork_replacement');
const latest = await store.get(created.id);
await this.archiveSession(source.project.id, latest?.sessionKey);
await persist(() => store.delete(created.id));