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

Fix stream iterator #7384

Merged
merged 4 commits into from
Mar 20, 2025
Merged

Fix stream iterator #7384

merged 4 commits into from
Mar 20, 2025

Conversation

enyst
Copy link
Collaborator

@enyst enyst commented Mar 20, 2025

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

End-user friendly description of the problem this fixes or functionality that this introduces.
Fix issue that was slowing agent responses as the conversation got longer


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

Fix iteration - it was going through the whole stream to make a list. 🤦


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:59d3869-nikolaik   --name openhands-app-59d3869   docker.all-hands.dev/all-hands-ai/openhands:59d3869

@enyst enyst mentioned this pull request Mar 20, 2025
2 tasks
@enyst enyst requested a review from rbren March 20, 2025 20:46
Copy link
Contributor

@malhotra5 malhotra5 left a comment

Choose a reason for hiding this comment

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

Nice catch!

@malhotra5
Copy link
Contributor

malhotra5 commented Mar 20, 2025

It seems like there's similar logic here to fetch first user message: https://github.com/All-Hands-AI/OpenHands/blob/2bd60c87c6b962f9eab97986e67cfff69372c766/openhands/controller/agent_controller.py#L944-#L957

Could possibly de-dup?

@enyst
Copy link
Collaborator Author

enyst commented Mar 20, 2025

Good point! Lets see

@enyst
Copy link
Collaborator Author

enyst commented Mar 20, 2025

It seems like there's similar logic here to fetch first user message: https://github.com/All-Hands-AI/OpenHands/blob/2bd60c87c6b962f9eab97986e67cfff69372c766/openhands/controller/agent_controller.py#L944-#L957

Could possibly de-dup?

I moved the dedup here:

That PR fixes a bug in the same area. I'll test them both. The reason why that PR is waiting is that I want to make a more complex test with two sessions restored in succession, and for some reason that proved tricky. But I'll finish it asap.

@enyst enyst merged commit 6f204fd into main Mar 20, 2025
13 checks passed
@enyst enyst deleted the enyst/fix-eventstream-iter branch March 20, 2025 22:25
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