.env.
Modal setup is required when
DEFAULT_SANDBOX_PROVIDER=modal (the default).What This Enables
- Sandbox execution for coding agents
- Filesystem snapshots and previews via Modal sandboxes
What You’ll Need
- A Modal account
- Modal API token (
MODAL_TOKEN_ID,MODAL_TOKEN_SECRET) - An app name (
MODAL_APP_NAME)
1) Deploy the Modal App
The codebase includes a minimal deploy script atpackages/modal-sandbox/deploy.py.
The provider expects a
get_image_id endpoint exposed by this deploy script. If it’s missing, you’ll see an error telling you to redeploy that file.2) Set Environment Variables
Add these to your.env file:
3) Restart Services
Troubleshooting
Sandbox creation fails (get_image_id not found)
Sandbox creation fails (get_image_id not found)
- Ensure
modal deploy packages/modal-sandbox/deploy.pycompleted successfully - Verify
MODAL_APP_NAMEmatches the deployed app name
Invalid token errors
Invalid token errors
- Confirm
MODAL_TOKEN_IDandMODAL_TOKEN_SECRETare correct - Regenerate tokens in Modal if needed
