From c9e6aa830b83647c4fc3738e1cfbb7cf8ce5303b Mon Sep 17 00:00:00 2001 From: rayhpeng Date: Thu, 23 Jul 2026 15:31:07 +0800 Subject: [PATCH] fix(frontend): carry feedback across the RunMessage conversion The message-list page rows attach the current user's feedback on the wrapper level, next to run_id; flattening RunMessage into Message kept run_id but dropped feedback, so thumb state was lost after a reload. --- frontend/src/core/threads/hooks.ts | 3 +++ frontend/src/core/threads/types.ts | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/frontend/src/core/threads/hooks.ts b/frontend/src/core/threads/hooks.ts index a0f96c0fd..78f023507 100644 --- a/frontend/src/core/threads/hooks.ts +++ b/frontend/src/core/threads/hooks.ts @@ -254,6 +254,9 @@ export function buildVisibleHistoryMessages( ...visibleRows.map((message) => ({ ...message.content, run_id: message.run_id, + // feedback also lives on the RunMessage wrapper (backend attaches it to + // the run's last AI row); carry it over or the thumbs lose their echo. + feedback: message.feedback ?? null, })), ]); } diff --git a/frontend/src/core/threads/types.ts b/frontend/src/core/threads/types.ts index 6042ed129..70c8728ba 100644 --- a/frontend/src/core/threads/types.ts +++ b/frontend/src/core/threads/types.ts @@ -1,5 +1,7 @@ import type { Message, Thread } from "@langchain/langgraph-sdk"; +import type { FeedbackData } from "@/core/api/feedback"; + import type { Todo } from "../todos"; export interface GoalState { @@ -54,6 +56,9 @@ export interface AgentThread extends Thread { export interface RunMessage { run_id: string; seq?: number; + /** Current user's feedback for the run, attached by the backend to the + * run's last AI message row (echo path for the thumb buttons). */ + feedback?: FeedbackData | null; content: Message; metadata: { caller: string;