feat(webui): track optimistic message delivery status (#5162)
This commit is contained in:
@@ -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)) {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user