fix(codex-api-proxy): propagate sys.path to daemon child
CI / check (push) Has been cancelled

This commit is contained in:
2026-11-09 22:22:25 +03:00
parent 5f0e9076e9
commit 19774c73f3
2 changed files with 25 additions and 0 deletions
@@ -0,0 +1,19 @@
--- a/src/codex_api_proxy/cli.py
+++ b/src/codex_api_proxy/cli.py
@@ -405,11 +405,15 @@
if args.proxy:
command.extend(["--proxy", args.proxy])
+ env = dict(os.environ)
+ env["PYTHONPATH"] = os.pathsep.join(path for path in sys.path if path)
+
with args.log_file.open("ab") as log:
process = subprocess.Popen(
command,
stdin=subprocess.DEVNULL,
stdout=log,
stderr=subprocess.STDOUT,
+ env=env,
start_new_session=True,
)
args.pid_file.write_text(f"{process.pid}\n", encoding="utf-8")