fix(webui): settle completed turns when fencing canonical history

This commit is contained in:
chenz authored and chengyongru committed 2026-11-17 17:59:01 +08:00
1 parent 966ed5e0bd
commit 9e499ad539
3 files changed
+92

No files matched your search

+5
View File
@@ -486,6 +486,11 @@ export class ClientRunLedger {
if (!turnId) continue;
chat ??= this.ensureChat(chatId);
chat.fenced.add(turnId);
// Explicit completion settles ownership even when the full page cannot be adopted.
this.rememberClosed(chat, turnId);
this.settle(chatId, turnId, effects);
// Anonymous recovery activity is independent of this named turn.
if (chat.latestTurnId === turnId) chat.effectiveStartedAt = null;
}
if (chat) this.trimTerminalSet(chat.fenced);
effects.push({ kind: "prune-inbound", chatId, turnIds: Array.from(chat?.fenced ?? []) });