From 7160bf80d5fe717d04148cc102923b0c148f06c4 Mon Sep 17 00:00:00 2001 From: wyf71 Date: Tue, 9 Dec 2025 17:14:23 -0800 Subject: [PATCH 1/2] Fix state not appearing on sse result, and image nopt rendering --- src/app/components/chat/chat.component.ts | 10 +++++++++- src/app/core/models/types.ts | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/app/components/chat/chat.component.ts b/src/app/components/chat/chat.component.ts index 75ae41e9..b3a7da37 100644 --- a/src/app/components/chat/chat.component.ts +++ b/src/app/components/chat/chat.component.ts @@ -505,8 +505,10 @@ export class ChatComponent implements OnInit, AfterViewInit, OnDestroy { } } else if (chunkJson.errorMessage) { this.processErrorMessage(chunkJson) - } else if (chunkJson.actions) { + } + if (chunkJson.actions) { this.processActionArtifact(chunkJson) + this.processActionStateDelta(chunkJson) } this.changeDetectorRef.detectChanges(); }, @@ -636,6 +638,12 @@ export class ChatComponent implements OnInit, AfterViewInit, OnDestroy { } } + private processActionStateDelta(e: AdkEvent) { + if (e.actions && e.actions.stateDelta && Object.keys(e.actions.stateDelta).length > 0) { + this.currentSessionState = e.actions.stateDelta; + } + } + /** * Collapse consecutive text parts into a single part. Preserves relative * order of other parts. diff --git a/src/app/core/models/types.ts b/src/app/core/models/types.ts index ef968661..a1bd6eef 100644 --- a/src/app/core/models/types.ts +++ b/src/app/core/models/types.ts @@ -80,6 +80,7 @@ export declare interface LlmResponse { export declare interface EventActions { message?: string; artifactDelta?: any; + stateDelta?: any; functionCall?: FunctionCall; functionResponse?: FunctionResponse; finishReason?: string; From 6b72c4e3bb2d254899e46493a39e5746f706368c Mon Sep 17 00:00:00 2001 From: wyf71 Date: Tue, 9 Dec 2025 17:20:33 -0800 Subject: [PATCH 2/2] artifactDelta needs to actually have diff --- src/app/components/chat/chat.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/components/chat/chat.component.ts b/src/app/components/chat/chat.component.ts index b3a7da37..c03b9f18 100644 --- a/src/app/components/chat/chat.component.ts +++ b/src/app/components/chat/chat.component.ts @@ -632,7 +632,7 @@ export class ChatComponent implements OnInit, AfterViewInit, OnDestroy { } private processActionArtifact(e: AdkEvent) { - if (e.actions && e.actions.artifactDelta) { + if (e.actions && e.actions.artifactDelta && Object.keys(e.actions.artifactDelta).length > 0) { this.storeEvents(null, e); this.storeMessage(null, e, 'bot'); }