fix(frontend): clicking think block in conversation pane breaks ui (v1 conversations) (#12057)

This commit is contained in:
Hiep Le 2025-12-16 20:14:19 +07:00 committed by GitHub
parent ee97542080
commit 49740a463f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 11 additions and 2 deletions

View File

@ -159,6 +159,9 @@ const getObservationEventTitle = (event: OpenHandsEvent): React.ReactNode => {
}
break;
}
case "ThinkObservation":
observationKey = "OBSERVATION_MESSAGE$THINK";
break;
default:
// For unknown observations, use the type name
return observationType.replace("Observation", "").toUpperCase();

View File

@ -190,7 +190,13 @@ const getThinkObservationContent = (
event: ObservationEvent<ThinkObservation>,
): string => {
const { observation } = event;
return observation.content || "";
const textContent = observation.content
.filter((c) => c.type === "text")
.map((c) => c.text)
.join("\n");
return textContent || "";
};
const getFinishObservationContent = (

View File

@ -36,7 +36,7 @@ export interface ThinkObservation extends ObservationBase<"ThinkObservation"> {
/**
* Confirmation message. DEFAULT: "Your thought has been logged."
*/
content: string;
content: Array<TextContent | ImageContent>;
}
export interface BrowserObservation extends ObservationBase<"BrowserObservation"> {