From edc43ca60d0fa7d0dfa457b880e8727c37138ea9 Mon Sep 17 00:00:00 2001 From: "sp.wack" <83104063+amanape@users.noreply.github.com> Date: Sat, 24 May 2025 13:39:37 +0400 Subject: [PATCH] fix(frontend): Fix `actionHasObservationPair` function to correctly identify pairs (#8661) Co-authored-by: openhands Co-authored-by: Xingyao Wang --- .../src/components/features/chat/event-message.tsx | 11 +++++------ frontend/src/components/features/chat/messages.tsx | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/frontend/src/components/features/chat/event-message.tsx b/frontend/src/components/features/chat/event-message.tsx index 5d50861c97..2739872ef2 100644 --- a/frontend/src/components/features/chat/event-message.tsx +++ b/frontend/src/components/features/chat/event-message.tsx @@ -48,12 +48,11 @@ export function EventMessage({ ); } - if ( - hasObservationPair && - isOpenHandsAction(event) && - hasThoughtProperty(event.args) - ) { - return ; + if (hasObservationPair && isOpenHandsAction(event)) { + if (hasThoughtProperty(event.args)) { + return ; + } + return null; } if (isFinishAction(event)) { diff --git a/frontend/src/components/features/chat/messages.tsx b/frontend/src/components/features/chat/messages.tsx index 2d00f7d8b6..73de59204e 100644 --- a/frontend/src/components/features/chat/messages.tsx +++ b/frontend/src/components/features/chat/messages.tsx @@ -49,7 +49,7 @@ export const Messages: React.FC = React.memo( return false; }, - [messages], + [], ); return (