authorgravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-04-01 08:56:04-07:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-04-01 08:56:04-07:00
log6d9b21c5d042ff992b26493563096459cb9158ac
tree3ca9aeecdb732b04ea16ca66ee05653c8d441d37
parentddffdfc0957315b422ae7bc092d4c2145866d3a2
signature Signed by PGP key B5690EEEBB952194

[codex] migrate Effect.fn in apps/server/src/provider/Layers/CodexProvider.ts (#1635)

Co-authored-by: codex <codex@users.noreply.github.com>

1 files changed, 13 insertions(+), 14 deletions(-)

apps/server/src/provider/Layers/CodexProvider.ts+13-14
...@@ -306,21 +306,20 @@ const probeCodexCapabilities = (input: {...@@ -306,21 +306,20 @@ const probeCodexCapabilities = (input: {
306 }),306 }),
307 );307 );
308308
309const runCodexCommand = (args: ReadonlyArray<string>) =>309const runCodexCommand = Effect.fn("runCodexCommand")(function* (args: ReadonlyArray<string>) {
310 Effect.gen(function* () {310 const settingsService = yield* ServerSettingsService;
311 const settingsService = yield* ServerSettingsService;311 const codexSettings = yield* settingsService.getSettings.pipe(
312 const codexSettings = yield* settingsService.getSettings.pipe(312 Effect.map((settings) => settings.providers.codex),
313 Effect.map((settings) => settings.providers.codex),313 );
314 );314 const command = ChildProcess.make(codexSettings.binaryPath, [...args], {
315 const command = ChildProcess.make(codexSettings.binaryPath, [...args], {315 shell: process.platform === "win32",
316 shell: process.platform === "win32",316 env: {
317 env: {317 ...process.env,
318 ...process.env,318 ...(codexSettings.homePath ? { CODEX_HOME: codexSettings.homePath } : {}),
319 ...(codexSettings.homePath ? { CODEX_HOME: codexSettings.homePath } : {}),319 },
320 },
321 });
322 return yield* spawnAndCollect(codexSettings.binaryPath, command);
323 });320 });
321 return yield* spawnAndCollect(codexSettings.binaryPath, command);
322});
324323
325export const checkCodexProviderStatus = Effect.fn("checkCodexProviderStatus")(function* (324export const checkCodexProviderStatus = Effect.fn("checkCodexProviderStatus")(function* (
326 resolveAccount?: (input: {325 resolveAccount?: (input: {