π OpenHands: AI-Driven Development
fix(frontend): correct handling of OBSERVATION_MESSAGE messages for task events (#11613)
Hiep Le7ef1720b5d4d
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.tsxindex 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 namereturn observationType.replace("Observation", "").toUpperCase();