diff --git a/cron/scheduler.py b/cron/scheduler.py index 4eae63a36394d..d0007902a297e 100644 --- a/cron/scheduler.py +++ b/cron/scheduler.py @@ -4690,6 +4690,9 @@ def run_job( os.environ.pop("TERMINAL_CWD", None) else: os.environ["TERMINAL_CWD"] = _prior_terminal_cwd + # Remove the process-wide cron sentinel so it does not leak into + # interactive gateway sessions running in the same process (#56771). + os.environ.pop("HERMES_CRON_SESSION", None) # Release the cwd lock now that the env is restored, so a waiting # workdir job (or queued reader) can proceed without seeing the override. if _cwd_lock_acquired: