fix(webui): resume queued prompts after turn completion (#6242)
* fix(webui): resume queued prompts after turn completion Persist the lifecycle turn each queued prompt waits for and use canonical completion identities to resume after navigation or reconnect. Release one entry at a time, and retain stopped or rejected entries for manual sending. * fix(webui): drain temporary chat prompts on live completion * perf(webui): resume queued prompts from live completion
This commit is contained in:
1 parent
3abcfe70c5
commit
836092424d
6 files changed
+339
-36
No files matched your search
@@ -336,6 +336,12 @@ export class NanobotClient {
|
||||
return this.latestRunTurnIdByChatId.get(chatId) ?? null;
|
||||
}
|
||||
|
||||
/** Whether a turn has a terminal wire, canonical, or local stop disposition. */
|
||||
isRunCompleted(chatId: string, turnId: string): boolean {
|
||||
return this.closedRunTurnIdsByChatId.get(chatId)?.has(turnId) === true
|
||||
|| this.canonicalCompletedTurnIdsByChatId.get(chatId)?.has(turnId) === true;
|
||||
}
|
||||
|
||||
/** Clear the optimistic run state immediately after the user stops a turn. */
|
||||
finishRunLocally(chatId: string): void {
|
||||
const unsettled = [...(this.unsettledRunTurnIdsByChatId.get(chatId) ?? [])];
|
||||
@@ -748,11 +754,6 @@ export class NanobotClient {
|
||||
);
|
||||
}
|
||||
|
||||
private isRunCompleted(chatId: string, turnId: string): boolean {
|
||||
return this.closedRunTurnIdsByChatId.get(chatId)?.has(turnId) === true
|
||||
|| this.canonicalCompletedTurnIdsByChatId.get(chatId)?.has(turnId) === true;
|
||||
}
|
||||
|
||||
private rememberRunCompletion(chatId: string, turnId: string): void {
|
||||
const closed = this.closedRunTurnIdsByChatId.get(chatId) ?? new Set<string>();
|
||||
closed.add(turnId);
|
||||
|
||||
Reference in new issue
Block a user