Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Filter matching events in reverse order #6485

Merged
merged 1 commit into from
Jan 27, 2025

Conversation

malhotra5
Copy link
Contributor

@malhotra5 malhotra5 commented Jan 27, 2025

End-user friendly description of the problem this fixes or functionality that this introduces

  • Include this change in the Release Notes. If checked, you must provide an end-user friendly description for your change below

Give a summary of what the PR does, explaining any non-trivial design decisions

Adds option to traverse events in reverse when filtering matching criteria


Link of any specific issues this addresses


To run this PR locally, use the following command:

docker run -it --rm   -p 3000:3000   -v /var/run/docker.sock:/var/run/docker.sock   --add-host host.docker.internal:host-gateway   -e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:dceaca4-nikolaik   --name openhands-app-dceaca4   docker.all-hands.dev/all-hands-ai/openhands:dceaca4

@malhotra5 malhotra5 requested a review from enyst January 27, 2025 22:18
@@ -378,6 +379,7 @@ def get_matching_events(
end_date: Filter events before this date (ISO format)
start_id: Starting ID in the event stream. Defaults to 0
limit: Maximum number of events to return. Must be between 1 and 100. Defaults to 100
reverse: Whether to retrieve events in reverse order. Defaults to False.

Returns:
list: List of matching events (as dicts)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not necessarily for this PR, but just a thought since we're looking at this: I'm not sure why we return dicts. It seems it would make sense to return events.

The FE-related methods are able to convert I think, and that would make this method potentially more useful in the backend too (which works with events usually, not with dicts)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I thought about the same thing; I'll look into this further...

Copy link
Collaborator

@enyst enyst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@malhotra5 malhotra5 enabled auto-merge (squash) January 27, 2025 22:46
@malhotra5 malhotra5 merged commit 94a64a4 into main Jan 27, 2025
18 checks passed
@malhotra5 malhotra5 deleted the feat/reverse-filter-event-stream branch January 27, 2025 22:53
zchn pushed a commit to zchn/OpenHands that referenced this pull request Feb 4, 2025
idagelic pushed a commit to idagelic/OpenHands that referenced this pull request Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants