Worker.from_env(), so you can set runtime policy
with MODAL_DEVIN_* environment variables through your preferred Modal configuration
mechanism.
Common settings
For example:
none and null, in any letter case, both mean indefinite snapshot retention.
Trace sessions with OpenTelemetry
The scheduler and session runtimes include Pydantic Logfire instrumentation. Every scheduler poll creates a trace, and each dispatched session continues that trace through claim acquisition, Sandbox startup, the Devin worker process, final status handling, and claim release. The handoff uses a W3C OpenTelemetry trace carrier stored with the short-lived dispatch lease, so it crosses the remote Modal function boundary without changing the generated function signature. To send traces to Pydantic Logfire, addLOGFIRE_TOKEN to the Modal Secret attached
to both generated functions. The existing generated Secret reference can contain both
credentials:
LOGFIRE_TOKEN and configure its OTLP/HTTP
endpoint instead:
devin.session.id, modal_devin.outpost.id, modal_devin.worker.name, and
modal.function.name.
Configure in Python
UseWorkerSettings when configuration belongs in version control:
Worker.from_env() instead when settings should come from MODAL_DEVIN_*
environment variables; it has no settings parameter, so the two approaches apply to
separate Worker instances rather than combining on one.
Preserve the generated timeout
Keep the session function decorator tied to the generated property:Choose snapshot retention
Modal’s Sandbox snapshot guide documents filesystem snapshot retention and expiration behavior.- Use the default 30 days for bounded recovery storage.
- Set a positive number of seconds for another finite duration.
- Use
Nonein Python ornonein the environment for indefinite retention.
Additional readiness, API, retry, and snapshot timing controls exist for unusual
deployments and support-guided troubleshooting. See the
settings reference before changing them.