Skip to content

fix(modal): container sandboxes take an idle_timeout from config - #683

Merged
psinghal20 merged 2 commits into
mainfrom
ryanchoi/modal-sandbox-idle-timeout
Dec 3, 2026
Merged

psinghal20 merged 2 commits into
mainfrom
ryanchoi/modal-sandbox-idle-timeout

Conversation

@rc9575

@rc9575 rc9575 commented Nov 14, 2026 •

Copy link
Copy Markdown
Collaborator

Scale's Modal budget enforcement ends any sandbox created without an idle timeout. Since 2026-11-13 it has been ending agent-env sandboxes mid-run every 15 minutes, failing ~95% of prompt_agent runs. The Modal VM provider already accepts idle_timeout, but the container provider had no way to set one.

ModalSandboxProvider now takes idle_timeout from [sandbox.providers.modal.config] and passes it to modal.Sandbox.create. Unset keeps today's behaviour, so nothing changes until a deployment sets the key. agentenvhub-sdk adds it for the modal provider once the worker's framework version includes this change; setting it before that fails the provider registry with an unexpected keyword.

Validation: a new wiring test checks the value reaches Modal's create call (and stays None when unset); it and the existing Modal provider unit tests pass (29), and ruff is clean.

🤖 Generated with Claude Code

Confidence Score: 5/5RetriggerView in Greptile

The PR appears safe to merge.

Summary

ModalSandboxProvider accepts idle_timeout from provider config and passes it to Modal.

  • Modal container sandboxes use the configured idle timeout.

Reviews (2) · Last reviewed commit: "chore(modal): drop the idle_timeout docs..." · Reviewed by Greptile

ModalSandboxProvider created every container sandbox with a timeout but
no idle_timeout, and the provider had no way to set one. Scale's Modal
budget enforcement ends sandboxes that have no idle timeout, which on
2026-11-13 killed agent containers mid-run every 15 minutes.

`[sandbox.providers.modal.config] idle_timeout` (seconds) now reaches
modal.Sandbox.create, as `[sandbox.providers.modal_vm.config]` already
does for VM sandboxes. Unset keeps today's behaviour.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rc9575
rc9575 requested a review from a team as a code owner November 14, 2026 01:42
…rg has one

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@psinghal20
psinghal20 merged commit 3c81715 into main Dec 3, 2026
34 of 35 checks passed
@psinghal20
psinghal20 deleted the ryanchoi/modal-sandbox-idle-timeout branch December 3, 2026 12:26
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