diff --git a/apps/ai-game-creator-shell/src/view/project-development/chat/controller/useDirectThreadChatSubscription.ts b/apps/ai-game-creator-shell/src/view/project-development/chat/controller/useDirectThreadChatSubscription.ts index 6434a03a3..90757bdce 100644 --- a/apps/ai-game-creator-shell/src/view/project-development/chat/controller/useDirectThreadChatSubscription.ts +++ b/apps/ai-game-creator-shell/src/view/project-development/chat/controller/useDirectThreadChatSubscription.ts @@ -117,6 +117,12 @@ export function useDirectThreadChatSubscription({ } finally { consuming = false; } + // 订阅过期恢复期间到达的通知只会把 consumeAgain 置位(此时 consuming 仍为 true), + // 而 do/while 已经因异常退出;这里补一次重排,否则这批事件要等下一次通知才被消费。 + if (!disposed && consumeAgain) { + consumeAgain = false; + void consume(); + } } async function bootstrap() { const result = await invoke(