fix(server): explain how to configure a missing Codex executable (#11345)
This commit is contained in:
1 parent
9a6b57be2a
commit
2a264adc6f
2 files changed
+29
-13
No files matched your search
@@ -628,7 +628,10 @@ export const checkCodexProviderStatus = Effect.fn("checkCodexProviderStatus")(fu
|
||||
auth: { status: "unknown" },
|
||||
message: installed
|
||||
? `Codex app-server provider probe failed: ${error.message}.`
|
||||
: "Codex CLI (`codex`) was not found on PATH.",
|
||||
: `Could not start Codex CLI (\`${codexSettings.binaryPath}\`). Check Settings → Providers → Codex → Binary path on the server.` +
|
||||
(codexSettings.binaryPath === "codex"
|
||||
? " Installing ChatGPT or Codex desktop may not add codex to PATH."
|
||||
: " Make sure the configured executable exists and can be run."),
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -513,20 +513,35 @@ it.layer(Layer.mergeAll(NodeServices.layer, ServerSettingsModule.layerTest(), Te
|
||||
}),
|
||||
);
|
||||
|
||||
it.effect("returns unavailable when codex is missing", () =>
|
||||
it.effect.each([
|
||||
"codex",
|
||||
"/Applications/Custom App.app/Contents/Resources/codex",
|
||||
"C:\\Tools\\codex.exe",
|
||||
])("explains how to configure a Codex executable that cannot start: %s", (binaryPath) =>
|
||||
Effect.gen(function* () {
|
||||
const status = yield* checkCodexProviderStatus(defaultCodexSettings, () =>
|
||||
Effect.fail(
|
||||
const settings = { ...defaultCodexSettings, binaryPath };
|
||||
const status = yield* checkCodexProviderStatus(settings, (input) => {
|
||||
assert.strictEqual(input.binaryPath, binaryPath);
|
||||
return Effect.fail(
|
||||
new CodexErrors.CodexAppServerSpawnError({
|
||||
command: "codex app-server",
|
||||
cause: new Error("spawn codex ENOENT"),
|
||||
command: `${binaryPath} app-server`,
|
||||
cause: new Error("spawn ENOENT"),
|
||||
}),
|
||||
),
|
||||
);
|
||||
);
|
||||
});
|
||||
assert.strictEqual(status.status, "error");
|
||||
assert.strictEqual(status.installed, false);
|
||||
assert.strictEqual(status.auth.status, "unknown");
|
||||
assert.strictEqual(status.message, "Codex CLI (`codex`) was not found on PATH.");
|
||||
assert.include(status.message, binaryPath);
|
||||
assert.include(
|
||||
status.message,
|
||||
"Settings → Providers → Codex → Binary path on the server",
|
||||
);
|
||||
assert.strictEqual(
|
||||
status.message?.includes("Installing ChatGPT or Codex desktop"),
|
||||
binaryPath === "codex",
|
||||
);
|
||||
assert.strictEqual(settings.binaryPath, binaryPath);
|
||||
}),
|
||||
);
|
||||
|
||||
@@ -2331,10 +2346,8 @@ it.layer(Layer.mergeAll(NodeServices.layer, ServerSettingsModule.layerTest(), Te
|
||||
"Real Codex probe against a missing binary should surface as 'error' in the aggregator",
|
||||
);
|
||||
assert.strictEqual(codexPersonal?.installed, false);
|
||||
assert.strictEqual(
|
||||
codexPersonal?.message,
|
||||
"Codex CLI (`codex`) was not found on PATH.",
|
||||
);
|
||||
assert.include(codexPersonal?.message, missingBinary);
|
||||
assert.include(codexPersonal?.message, "Settings → Providers → Codex → Binary path");
|
||||
}).pipe(Effect.provide(runtimeServices));
|
||||
}),
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user