Skip to content

Use Modal async Sandbox APIs#196

Merged
carlosejimenez merged 1 commit intoSWE-agent:mainfrom
saltzm:main
May 24, 2025
Merged

Use Modal async Sandbox APIs#196
carlosejimenez merged 1 commit intoSWE-agent:mainfrom
saltzm:main

Conversation

@saltzm
Copy link
Collaborator

@saltzm saltzm commented May 1, 2025

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_url function async. 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 modal

I 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).

@carlosejimenez carlosejimenez merged commit 4b6b194 into SWE-agent:main May 24, 2025
3 of 4 checks passed
@carlosejimenez
Copy link
Member

Thanks Matthew!

This will be in v1.2.2

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