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
628628 auth: { status: "unknown" },
629629 message: installed
630630 ? `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."),
632635 },
633636 });
634637 }
apps/server/src/provider/Layers/ProviderRegistry.test.ts+25-12
......@@ -513,20 +513,35 @@ it.layer(Layer.mergeAll(NodeServices.layer, ServerSettingsModule.layerTest(), Te
513513 }),
514514 );
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) =>
517521 Effect.gen(function* () {
518 const status = yield* checkCodexProviderStatus(defaultCodexSettings, () =>
519 Effect.fail(
522 const settings = { ...defaultCodexSettings, binaryPath };
523 const status = yield* checkCodexProviderStatus(settings, (input) => {
524 assert.strictEqual(input.binaryPath, binaryPath);
525 return Effect.fail(
520526 new CodexErrors.CodexAppServerSpawnError({
521 command: "codex app-server",
522 cause: new Error("spawn codex ENOENT"),
527 command: `${binaryPath} app-server`,
528 cause: new Error("spawn ENOENT"),
523529 }),
524 ),
525 );
530 );
531 });
526532 assert.strictEqual(status.status, "error");
527533 assert.strictEqual(status.installed, false);
528534 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);
530545 }),
531546 );
532547
......@@ -2331,10 +2346,8 @@ it.layer(Layer.mergeAll(NodeServices.layer, ServerSettingsModule.layerTest(), Te
23312346 "Real Codex probe against a missing binary should surface as 'error' in the aggregator",
23322347 );
23332348 assert.strictEqual(codexPersonal?.installed, false);
2334 assert.strictEqual(
2335 codexPersonal?.message,
2336 "Codex CLI (`codex`) was not found on PATH.",
2337 );
2349 assert.include(codexPersonal?.message, missingBinary);
2350 assert.include(codexPersonal?.message, "Settings → Providers → Codex → Binary path");
23382351 }).pipe(Effect.provide(runtimeServices));
23392352 }),
23402353 );