#!/usr/bin/env python3
import os,sys,signal,pathlib
root=pathlib.Path(__file__).parent
if "app-server" in sys.argv and (root/"suspend").exists():
    with (root/"suspended-pids").open("a") as f: f.write(str(os.getpid())+"\n")
    os.kill(os.getpid(),signal.SIGSTOP)
os.execv("/usr/local/bin/codex",["codex",*sys.argv[1:]])
