mirror of
https://github.com/OpenHands/OpenHands.git
synced 2025-12-25 21:36:52 +08:00
fix(frontend): clicking think block in conversation pane breaks ui (v1 conversations) (#12057)
This commit is contained in:
parent
ee97542080
commit
49740a463f
@ -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();
|
||||
|
||||
@ -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 = (
|
||||
|
||||
@ -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"> {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user