fix: pass terminal_lifetime through to Modal sandbox timeout

The lifetime_seconds config was computed and stored as an env var but
never reached Modal's Sandbox.create(timeout=...), causing sandboxes to
always die after the hardcoded 1h default regardless of configuration.
This commit is contained in:
alt-glitch 2026-04-13 11:57:39 -07:00
parent d77783d198
commit f7d57c0108
3 changed files with 405 additions and 1 deletions

View file

@ -185,7 +185,7 @@ class ManagedModalEnvironment(BaseModalExecutionEnvironment):
"cwd": self.cwd,
"cpu": cpu,
"memoryMiB": memory,
"timeoutMs": 3_600_000,
"timeoutMs": int(self._sandbox_kwargs.get("timeout", 3600)) * 1000,
"idleTimeoutMs": max(300_000, int(self.timeout * 1000)),
"persistentFilesystem": self._persistent,
"logicalKey": self._task_id,