nemo_gym.agent_utils.supervisor_client
nemo_gym.agent_utils.supervisor_client
Controller-side transport for the shared sandbox process supervisor.
Session ownership and cancellation live in sandbox_session.py; output parsing stays with the adapter. Unlike process_supervisor.py, this module is not uploaded to the task sandbox.
Session control files (all paths are relative to session_dir):
===================== ==================== =========================================== Filename Writer When ===================== ==================== =========================================== process_supervisor.py Session Uploaded before launch launch.claim Launch or stop shell Atomically claims launch or fences it supervisor.pid Launch shell After claiming launch, before exec stop.request Stop shell Before signalling the supervisor cleanup.json Supervisor or stop After cleanup, or when stop fences launch output.log Launch shell Captures supervisor and harness diagnostics ===================== ==================== ===========================================
Module Contents
Functions
Data
API
Require positive cleanup evidence, tolerating malformed optional diagnostics.
Remove adapter-owned files after cleanup, keeping delayed launches fenced.
Retire the directory atomically before unlinking its claim. Otherwise a delayed launch could win the claim while recursive deletion is in progress. A failed removal leaves the retired path available for a close retry.
Fence a pending launch or require explicit supervisor acknowledgement before teardown.
A stop that wins the launch claim writes the same receipt shape as the supervisor, with no return code because no harness process ran.
Fence delayed launches and run a harness command under the shared supervisor.
The adapter must install or select the interpreter explicitly. Check that it can load the supervisor before claiming a launch: a failed bootstrap cannot write a cleanup receipt. Supervisor and harness diagnostics share output.log.
Return the per-cleanup-phase and provider execution deadlines.
Divide the close budget across TERM grace, harness process reaping, and descendant draining. The provider deadline reserves all three phases after the harness timeout, plus 30 seconds for startup, polling, and receipt I/O.