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.
This commit is contained in:
rayhpeng 2026-07-23 15:31:07 +08:00
parent 808e31e2ee
commit c9e6aa830b
2 changed files with 8 additions and 0 deletions

View File

@ -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,
})),
]);
}

View File

@ -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<AgentThreadState> {
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;