tools: install Codex into the worker executable path

Use a global npm install within the service user's prefix so the configured .local/bin launcher exists. Exercise npm with an offline synthetic package and check the installed launcher without contacting a provider.

Refs #19
This commit is contained in:
Florian Schmidt
2026-11-15 11:15:06 +01:00
parent 583f920307
commit e1488243e1
3 changed files with 58 additions and 1 deletions
+1 -1
View File
@@ -121,7 +121,7 @@ def official_clis(providers):
script.chmod(0o644)
as_user("finaltoken", WORKER_HOME, ["bash", str(script), "stable"])
if "codex" in providers and not (WORKER_HOME / ".local/bin/codex").exists():
as_user("finaltoken", WORKER_HOME, ["npm", "install", "--prefix", str(WORKER_HOME / ".local"), "@openai/codex@latest"])
as_user("finaltoken", WORKER_HOME, ["npm", "install", "--global", "--prefix", str(WORKER_HOME / ".local"), "@openai/codex@latest"])
for provider in providers:
as_user("finaltoken", WORKER_HOME, [str(WORKER_HOME / ".local/bin" / provider), "--version"])