Fix: Include RecallObservation in events sent to frontend from ENVIRONMENT source (#8196)

Co-authored-by: openhands <openhands@all-hands.dev>
This commit is contained in:
Xingyao Wang 2025-05-02 18:18:37 +08:00 committed by GitHub
parent 6e0fbfeeda
commit e4c3bbbc08
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -22,6 +22,7 @@ from openhands.events.observation import (
NullObservation,
)
from openhands.events.observation.error import ErrorObservation
from openhands.events.observation.agent import RecallObservation
from openhands.events.serialization import event_from_dict, event_to_dict
from openhands.events.stream import EventStreamSubscriber
from openhands.llm.llm import LLM
@ -213,7 +214,7 @@ class Session:
await self.send(event_to_dict(event))
# NOTE: ipython observations are not sent here currently
elif event.source == EventSource.ENVIRONMENT and isinstance(
event, (CmdOutputObservation, AgentStateChangedObservation)
event, (CmdOutputObservation, AgentStateChangedObservation, RecallObservation)
):
# feedback from the environment to agent actions is understood as agent events by the UI
event_dict = event_to_dict(event)