Add executable detection and export Codex from the SDK (#4532)

Executable detection uses the same rules as the codex wrapper.
This commit is contained in:
pakrym-oai
2025-09-30 18:06:16 -07:00
committed by GitHub
parent 32853ecbc5
commit 8dd771d217
10 changed files with 116 additions and 29 deletions

View File

@@ -23,7 +23,7 @@ describe("Codex", () => {
});
try {
const client = new Codex({ executablePath: codexExecPath, baseUrl: url, apiKey: "test" });
const client = new Codex({ codexPathOverride: codexExecPath, baseUrl: url, apiKey: "test" });
const thread = client.startThread();
const result = await thread.run("Hello, world!");
@@ -60,7 +60,7 @@ describe("Codex", () => {
});
try {
const client = new Codex({ executablePath: codexExecPath, baseUrl: url, apiKey: "test" });
const client = new Codex({ codexPathOverride: codexExecPath, baseUrl: url, apiKey: "test" });
const thread = client.startThread();
await thread.run("first input");
@@ -103,7 +103,7 @@ describe("Codex", () => {
});
try {
const client = new Codex({ executablePath: codexExecPath, baseUrl: url, apiKey: "test" });
const client = new Codex({ codexPathOverride: codexExecPath, baseUrl: url, apiKey: "test" });
const thread = client.startThread();
await thread.run("first input");
@@ -149,7 +149,7 @@ describe("Codex", () => {
});
try {
const client = new Codex({ executablePath: codexExecPath, baseUrl: url, apiKey: "test" });
const client = new Codex({ codexPathOverride: codexExecPath, baseUrl: url, apiKey: "test" });
const originalThread = client.startThread();
await originalThread.run("first input");
@@ -193,7 +193,7 @@ describe("Codex", () => {
const { args: spawnArgs, restore } = codexExecSpy();
try {
const client = new Codex({ executablePath: codexExecPath, baseUrl: url, apiKey: "test" });
const client = new Codex({ codexPathOverride: codexExecPath, baseUrl: url, apiKey: "test" });
const thread = client.startThread();
await thread.run("apply options", {

View File

@@ -23,7 +23,7 @@ describe("Codex", () => {
});
try {
const client = new Codex({ executablePath: codexExecPath, baseUrl: url, apiKey: "test" });
const client = new Codex({ codexPathOverride: codexExecPath, baseUrl: url, apiKey: "test" });
const thread = client.startThread();
const result = await thread.runStreamed("Hello, world!");
@@ -82,7 +82,7 @@ describe("Codex", () => {
});
try {
const client = new Codex({ executablePath: codexExecPath, baseUrl: url, apiKey: "test" });
const client = new Codex({ codexPathOverride: codexExecPath, baseUrl: url, apiKey: "test" });
const thread = client.startThread();
const first = await thread.runStreamed("first input");
@@ -128,7 +128,7 @@ describe("Codex", () => {
});
try {
const client = new Codex({ executablePath: codexExecPath, baseUrl: url, apiKey: "test" });
const client = new Codex({ codexPathOverride: codexExecPath, baseUrl: url, apiKey: "test" });
const originalThread = client.startThread();
const first = await originalThread.runStreamed("first input");