fix(frontend): correct handling of OBSERVATION_MESSAGE messages for task events (#11613)

This commit is contained in:
Hiep Le 2025-11-03 18:57:11 +07:00 committed by GitHub
parent a6385b4059
commit 7ef1720b5d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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();