feat(sandbox): add main restart policy (#2798)

* feat(sandbox): add main restart policy

Signed-off-by: Drew Newberry <anewberry@nvidia.com>

* fix(sandbox): harden policy-driven restarts

Signed-off-by: Drew Newberry <anewberry@nvidia.com>

* fix(sandbox): address restart review feedback

Signed-off-by: Drew Newberry <385+drew@users.noreply.github.com>

* fix(sandbox): port restart policy to current runtime

Signed-off-by: Drew Newberry <anewberry@nvidia.com>

* perf(sandbox): restart promptly after terminal delivery

Signed-off-by: Drew Newberry <anewberry@nvidia.com>

---------

Signed-off-by: Drew Newberry <anewberry@nvidia.com>
Signed-off-by: Drew Newberry <385+drew@users.noreply.github.com>
This commit is contained in:
Drew Newberry
2026-09-29 02:18:30 +00:00
committed by GitHub
parent 1358941b81
commit acbac9cb79
36 changed files with 2968 additions and 898 deletions
+6
View File
@@ -2719,10 +2719,16 @@ def test_sandbox_ref_retains_gateway_labels() -> None:
def test_sandbox_ref_includes_main_process_result() -> None:
proto = _make_sandbox_proto("sandbox-1", "job-1")
proto.status.exit_code = 0
proto.status.restart_count = 2
proto.status.next_restart_time.FromMilliseconds(1_700_000_000_000)
proto.status.main_process_started_time.FromMilliseconds(1_699_999_000_000)
status = _sandbox_ref(proto).status
assert status.exit_code == 0
assert status.restart_count == 2
assert status.next_restart_at_ms == 1_700_000_000_000
assert status.main_process_started_at_ms == 1_699_999_000_000
def test_returned_labels_are_immutable() -> None: