()
| 31 | } |
| 32 | |
| 33 | async function stopActiveWork(): Promise<void> { |
| 34 | const stopped = await streamingManager.stopAll() |
| 35 | const currentContext = persistence.database.getActiveContext() |
| 36 | if (currentContext.accountId && currentContext.workspacePath) { |
| 37 | for (const item of stopped) { |
| 38 | if (item.content) { |
| 39 | await messagesService.updateMessage(item.pageId, item.messageId, { |
| 40 | content: item.content, |
| 41 | reasoning_content: item.reasoning |
| 42 | }) |
| 43 | } else { |
| 44 | await messagesService.deleteMessage(item.pageId, item.messageId) |
| 45 | } |
| 46 | } |
| 47 | } |
| 48 | streamingManager.reset() |
| 49 | await flushAllPersistenceQueues() |
| 50 | } |
| 51 | |
| 52 | async function waitForScopedWrites(scope: WorkspaceScope | null): Promise<void> { |
| 53 | const context = persistence.database.getActiveContext() |
no test coverage detected