| ... | @@ -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 | ); |
| 515 | | 515 | |
| 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 | ); |
| 532 | | 547 | |
| ... | @@ -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 | ); |