Fix search_events signature mismatches after get_events replacement (#9238)

Co-authored-by: openhands <openhands@all-hands.dev>
This commit is contained in:
Xingyao Wang 2025-06-19 11:57:44 -04:00 committed by GitHub
parent b7a6190133
commit cc2f96c6c4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 2 deletions

View File

@ -3,6 +3,7 @@ from fastapi.responses import JSONResponse
from openhands.core.logger import openhands_logger as logger
from openhands.events.async_event_store_wrapper import AsyncEventStoreWrapper
from openhands.events.event_filter import EventFilter
from openhands.events.serialization import event_to_dict
from openhands.server.data_models.feedback import FeedbackDataModel, store_feedback
from openhands.server.dependencies import get_dependencies
@ -41,7 +42,9 @@ async def submit_feedback(
# Assuming the storage service is already configured in the backend
# and there is a function to handle the storage.
body = await request.json()
async_store = AsyncEventStoreWrapper(conversation.event_stream, filter_hidden=True)
async_store = AsyncEventStoreWrapper(
conversation.event_stream, filter=EventFilter(exclude_hidden=True)
)
trajectory = []
async for event in async_store:
trajectory.append(event_to_dict(event))

View File

@ -3,6 +3,7 @@ from fastapi.responses import JSONResponse
from openhands.core.logger import openhands_logger as logger
from openhands.events.async_event_store_wrapper import AsyncEventStoreWrapper
from openhands.events.event_filter import EventFilter
from openhands.events.serialization import event_to_trajectory
from openhands.server.dependencies import get_dependencies
from openhands.server.session.conversation import ServerConversation
@ -30,7 +31,7 @@ async def get_trajectory(
"""
try:
async_store = AsyncEventStoreWrapper(
conversation.event_stream, filter_hidden=True
conversation.event_stream, filter=EventFilter(exclude_hidden=True)
)
trajectory = []
async for event in async_store: