authorgravatar for 91240327+shivamhwp@users.noreply.github.comshivam <91240327+shivamhwp@users.noreply.github.com> 2026-09-15 22:41:54+05:30
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-09-15 14:11:54-03:00
log2a264adc6f6c65f98d4273acaa1af567eca83f2a
tree1fdfe03983fbd202d1fd4537dde60e372b059e51
parent9a6b57be2ae601e6969669a8ad276f974b2a5978
signature Signed by PGP key B5690EEEBB952194

fix(server): explain how to configure a missing Codex executable (#11345)


2 files changed, 29 insertions(+), 13 deletions(-)

apps/server/src/provider/Layers/CodexProvider.ts+4-1
...@@ -628,7 +628,10 @@ export const checkCodexProviderStatus = Effect.fn("checkCodexProviderStatus")(fu...@@ -628,7 +628,10 @@ export const checkCodexProviderStatus = Effect.fn("checkCodexProviderStatus")(fu
628 auth: { status: "unknown" },628 auth: { status: "unknown" },
629 message: installed629 message: installed
630 ? `Codex app-server provider probe failed: ${error.message}.`630 ? `Codex app-server provider probe failed: ${error.message}.`
631 : "Codex CLI (`codex`) was not found on PATH.",631 : `Could not start Codex CLI (\`${codexSettings.binaryPath}\`). Check Settings → Providers → Codex → Binary path on the server.` +
632 (codexSettings.binaryPath === "codex"
633 ? " Installing ChatGPT or Codex desktop may not add codex to PATH."
634 : " Make sure the configured executable exists and can be run."),
632 },635 },
633 });636 });
634 }637 }
apps/server/src/provider/Layers/ProviderRegistry.test.ts+25-12
...@@ -513,20 +513,35 @@ it.layer(Layer.mergeAll(NodeServices.layer, ServerSettingsModule.layerTest(), Te...@@ -513,20 +513,35 @@ it.layer(Layer.mergeAll(NodeServices.layer, ServerSettingsModule.layerTest(), Te
513 }),513 }),
514 );514 );
515515
516 it.effect("returns unavailable when codex is missing", () =>516 it.effect.each([
517 "codex",
518 "/Applications/Custom App.app/Contents/Resources/codex",
519 "C:\\Tools\\codex.exe",
520 ])("explains how to configure a Codex executable that cannot start: %s", (binaryPath) =>
517 Effect.gen(function* () {521 Effect.gen(function* () {
518 const status = yield* checkCodexProviderStatus(defaultCodexSettings, () =>522 const settings = { ...defaultCodexSettings, binaryPath };
519 Effect.fail(523 const status = yield* checkCodexProviderStatus(settings, (input) => {
524 assert.strictEqual(input.binaryPath, binaryPath);
525 return Effect.fail(
520 new CodexErrors.CodexAppServerSpawnError({526 new CodexErrors.CodexAppServerSpawnError({
521 command: "codex app-server",527 command: `${binaryPath} app-server`,
522 cause: new Error("spawn codex ENOENT"),528 cause: new Error("spawn ENOENT"),
523 }),529 }),
524 ),530 );
525 );531 });
526 assert.strictEqual(status.status, "error");532 assert.strictEqual(status.status, "error");
527 assert.strictEqual(status.installed, false);533 assert.strictEqual(status.installed, false);
528 assert.strictEqual(status.auth.status, "unknown");534 assert.strictEqual(status.auth.status, "unknown");
529 assert.strictEqual(status.message, "Codex CLI (`codex`) was not found on PATH.");535 assert.include(status.message, binaryPath);
536 assert.include(
537 status.message,
538 "Settings → Providers → Codex → Binary path on the server",
539 );
540 assert.strictEqual(
541 status.message?.includes("Installing ChatGPT or Codex desktop"),
542 binaryPath === "codex",
543 );
544 assert.strictEqual(settings.binaryPath, binaryPath);
530 }),545 }),
531 );546 );
532547
...@@ -2331,10 +2346,8 @@ it.layer(Layer.mergeAll(NodeServices.layer, ServerSettingsModule.layerTest(), Te...@@ -2331,10 +2346,8 @@ it.layer(Layer.mergeAll(NodeServices.layer, ServerSettingsModule.layerTest(), Te
2331 "Real Codex probe against a missing binary should surface as 'error' in the aggregator",2346 "Real Codex probe against a missing binary should surface as 'error' in the aggregator",
2332 );2347 );
2333 assert.strictEqual(codexPersonal?.installed, false);2348 assert.strictEqual(codexPersonal?.installed, false);
2334 assert.strictEqual(2349 assert.include(codexPersonal?.message, missingBinary);
2335 codexPersonal?.message,2350 assert.include(codexPersonal?.message, "Settings → Providers → Codex → Binary path");
2336 "Codex CLI (`codex`) was not found on PATH.",
2337 );
2338 }).pipe(Effect.provide(runtimeServices));2351 }).pipe(Effect.provide(runtimeServices));
2339 }),2352 }),
2340 );2353 );