feat(webui): track optimistic message delivery status (#5162)

This commit is contained in:
chengyongru
2026-07-29 23:15:45 +08:00
committed by GitHub
parent 5a28a6165c
commit 129b74b4cf
23 changed files with 431 additions and 21 deletions
+3
View File
@@ -935,6 +935,9 @@ export class NanobotClient {
: null;
if (parsed.event === "message_accepted") {
this.recordRunAcceptance(parsed.chat_id, parsed.turn_id);
if (!isSystemCommandTurnId(turnId)) {
this.dispatch(parsed.chat_id, parsed);
}
return;
}
if (isSystemCommandTurnId(turnId)) {
+9
View File
@@ -5,6 +5,11 @@ export type Role = "user" | "assistant" | "tool" | "system";
export type MessageKind = "message" | "trace";
export type UITurnPhase = "user" | "reasoning" | "activity" | "answer" | "complete";
export type MessageDeliveryStatus = "sending" | "accepted" | "failed";
export type MessageDeliveryErrorKind =
| "message_too_big"
| "workspace_scope_rejected"
| "turn_rejected";
/** One image attached to a UIMessage.
*
@@ -76,6 +81,10 @@ export interface UIMessage {
turnId?: string;
turnPhase?: UITurnPhase;
turnSeq?: number;
/** Ephemeral delivery lifecycle for optimistic user messages. */
deliveryStatus?: MessageDeliveryStatus;
/** Structured rejection reason shown with a failed optimistic message. */
deliveryErrorKind?: MessageDeliveryErrorKind;
}
export interface UICliAppAttachment {