replace execSync cases with spawnSync, use correct package @openai/codex

This commit is contained in:
Shawn Morreau
2025-11-13 07:31:45 -05:00
parent 586477f456
commit 5f9a839ef0
5 changed files with 6008 additions and 6835 deletions
+5 -5
View File
@@ -8,9 +8,9 @@ export const codex = agent({
inputKey: "openai_api_key",
install: async () => {
return await installFromNpmTarball({
packageName: "codex",
packageName: "@openai/codex",
version: "latest",
executablePath: "bin/codex",
executablePath: "bin/codex.js",
installDependencies: true,
});
},
@@ -43,8 +43,8 @@ export const codex = agent({
}
log.info(`Adding MCP server '${serverName}'...`);
const addResult = spawnSync(cliPath, addArgs, {
stdio: "inherit",
const addResult = spawnSync("node", [cliPath, ...addArgs], {
stdio: "pipe",
encoding: "utf-8",
env: {
...process.env,
@@ -70,7 +70,7 @@ export const codex = agent({
log.info("Running Codex via CLI...");
try {
const result = spawnSync(cliPath, ["exec", addInstructions(prompt)], {
const result = spawnSync("node", [cliPath, "exec", addInstructions(prompt)], {
encoding: "utf-8",
env: {
...process.env,