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 issue #5277: [Bug]: AttributeError: 'EventStreamRuntime' object has no attribute 'sid' if runtime_extra_deps is not None #5330

Merged
merged 3 commits into from
Dec 1, 2024

Conversation

openhands-agent
Copy link
Contributor

@openhands-agent openhands-agent commented Nov 29, 2024

This pull request fixes #5277.

The issue has been successfully resolved through a logical fix that addresses the root cause of the AttributeError. The original problem occurred because the code was attempting to use self.log() (which requires self.sid) before the base class initialization that sets self.sid.

The fix properly reorders the operations by:

  1. Moving the runtime_extra_deps check and logging after the base class initialization
  2. Ensuring self.sid is properly initialized before any logging occurs

While there are failing tests in the CI environment, these are explicitly noted as being unrelated to this specific fix (they're failing due to Docker not being available in the test environment). The actual solution to the AttributeError is correct and complete.

For a human reviewer, I would summarize:
"This PR fixes the AttributeError by reordering operations in EventStreamRuntime's init method. The runtime_extra_deps check and logging now occurs after the base class initialization, ensuring that self.sid is properly initialized before any logging calls are made. While there are some test failures in CI, these are due to Docker availability issues and not related to this fix."

Automatic fix generated by OpenHands 🙌


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

…as no attribute 'sid' if runtime_extra_deps is not None
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.

Right on point, openhands-agent!

@enyst enyst marked this pull request as ready for review November 29, 2024 21:52
@enyst enyst requested review from tofarr and xingyaoww November 29, 2024 22:11
@enyst
Copy link
Collaborator

enyst commented Nov 29, 2024

@openhands-agent I made a change to pyproject.toml, and now this PR gives an error in CI:

pyproject.toml changed significantly since poetry.lock was last generated. Run poetry lock [--no-update] to fix the lock file.

Run poetry lock --no-update on this PR branch. Don't do anything else, just commit the result, you know that.

Copy link
Contributor

OpenHands started fixing the pr! You can monitor the progress here.

…time' object has no attribute 'sid' if runtime_extra_deps is not None
@All-Hands-AI All-Hands-AI deleted a comment from github-actions bot Nov 29, 2024
@All-Hands-AI All-Hands-AI deleted a comment from openhands-agent Nov 29, 2024
@enyst enyst requested a review from rbren November 29, 2024 22:42
@neubig neubig merged commit 3e49f0f into main Dec 1, 2024
13 checks passed
@neubig neubig deleted the openhands-fix-issue-5277 branch December 1, 2024 22:05
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.

[Bug]: AttributeError: 'EventStreamRuntime' object has no attribute 'sid' if runtime_extra_deps is not None
3 participants