Use Modal async Sandbox APIs#196
Merged
carlosejimenez merged 1 commit intoSWE-agent:mainfrom May 24, 2025
Merged
Conversation
Member
|
Thanks Matthew! This will be in v1.2.2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The existing Modal deployment uses the blocking version of Modal Sandbox APIs from within async functions which interferes with the asyncio event loop.
This changes the Modal deployment to use the async versions of these functions.
The only breaking API change is making the
get_modal_log_urlfunctionasync. This isn't called from anywhere in the rest of the SWE-ReX repo right now.I also increased the startup timeout on the Modal test that deploys from the Dockerfile since that one was failing due to a timeout. (Building the image takes a while - comfortably less than 5 minutes though.)
I tested this with the following commands, and the tests passed:
$ pip install . $ pytest -k modalI also ran a test that uses SWE-ReX with Modal from concurrent tasks using this version and could see that sandbox creation was happening concurrently as expected (rather than sequentially, as it works currently).