Skip to content

Improve type coverage for nested runtime #8921

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

Merged
merged 3 commits into from
Jun 5, 2025
Merged

Conversation

raymyers
Copy link
Contributor

@raymyers raymyers commented Jun 5, 2025

  • This change is worth documenting at https://docs.all-hands.dev/
  • 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 this introduces.


Summarize what the PR does, explaining any non-trivial design decisions.

Running a mypy html report, I found that we have lots of "Imprecision", things mypy cannot check. Adding more dependencies in the pre-commit config and adding type annotations on some untyped globals helps address this.

This PR cuts docker_nested_conversation_manager's imprecision (unchecked lines) in half from roughly 23% to 12%.


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

@raymyers raymyers requested a review from tofarr June 5, 2025 15:23
@@ -480,7 +482,7 @@ async def _start_existing_container(self, runtime: DockerRuntime) -> bool:
if container:
status = container.status
if status == 'exited':
await call_sync_from_async(container.start())
await call_sync_from_async(container.start)
Copy link
Contributor Author

@raymyers raymyers Jun 5, 2025

Choose a reason for hiding this comment

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

This one looks like it was a bug.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice catch!

Copy link
Collaborator

@tofarr tofarr left a comment

Choose a reason for hiding this comment

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

🍰

@raymyers raymyers enabled auto-merge (squash) June 5, 2025 16:19
@raymyers raymyers merged commit dee8946 into main Jun 5, 2025
21 checks passed
@raymyers raymyers deleted the ray/nested-runtime-types branch June 5, 2025 16:19
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