From 7ef1720b5d4d56e81b9a7058f861159fd4d2b215 Mon Sep 17 00:00:00 2001 From: Hiep Le <69354317+hieptl@users.noreply.github.com> Date: Mon, 3 Nov 2025 18:57:11 +0700 Subject: [PATCH] fix(frontend): correct handling of OBSERVATION_MESSAGE messages for task events (#11613) --- .../chat/event-content-helpers/get-event-content.tsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/v1/chat/event-content-helpers/get-event-content.tsx b/frontend/src/components/v1/chat/event-content-helpers/get-event-content.tsx index c1f36843de..b2e7d69868 100644 --- a/frontend/src/components/v1/chat/event-content-helpers/get-event-content.tsx +++ b/frontend/src/components/v1/chat/event-content-helpers/get-event-content.tsx @@ -134,9 +134,16 @@ const getObservationEventTitle = (event: OpenHandsEvent): React.ReactNode => { case "BrowserObservation": observationKey = "OBSERVATION_MESSAGE$BROWSE"; break; - case "TaskTrackerObservation": - observationKey = "OBSERVATION_MESSAGE$TASK_TRACKING"; + case "TaskTrackerObservation": { + const { command } = event.observation; + if (command === "plan") { + observationKey = "OBSERVATION_MESSAGE$TASK_TRACKING_PLAN"; + } else { + // command === "view" + observationKey = "OBSERVATION_MESSAGE$TASK_TRACKING_VIEW"; + } break; + } default: // For unknown observations, use the type name return observationType.replace("Observation", "").toUpperCase();