From 9088bf016a1e26e2adcee921b936b4cc107c511b Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Wed, 1 Apr 2026 00:27:27 -0700 Subject: [PATCH] migrate Effect.fn in apps/server/src/provider/Layers/CodexProvider.ts Co-authored-by: codex --- .../src/provider/Layers/CodexProvider.ts | 27 +++++++++---------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/apps/server/src/provider/Layers/CodexProvider.ts b/apps/server/src/provider/Layers/CodexProvider.ts index 499d4c6ffd..667bdf048b 100644 --- a/apps/server/src/provider/Layers/CodexProvider.ts +++ b/apps/server/src/provider/Layers/CodexProvider.ts @@ -306,21 +306,20 @@ const probeCodexCapabilities = (input: { }), ); -const runCodexCommand = (args: ReadonlyArray) => - Effect.gen(function* () { - const settingsService = yield* ServerSettingsService; - const codexSettings = yield* settingsService.getSettings.pipe( - Effect.map((settings) => settings.providers.codex), - ); - const command = ChildProcess.make(codexSettings.binaryPath, [...args], { - shell: process.platform === "win32", - env: { - ...process.env, - ...(codexSettings.homePath ? { CODEX_HOME: codexSettings.homePath } : {}), - }, - }); - return yield* spawnAndCollect(codexSettings.binaryPath, command); +const runCodexCommand = Effect.fn("runCodexCommand")(function* (args: ReadonlyArray) { + const settingsService = yield* ServerSettingsService; + const codexSettings = yield* settingsService.getSettings.pipe( + Effect.map((settings) => settings.providers.codex), + ); + const command = ChildProcess.make(codexSettings.binaryPath, [...args], { + shell: process.platform === "win32", + env: { + ...process.env, + ...(codexSettings.homePath ? { CODEX_HOME: codexSettings.homePath } : {}), + }, }); + return yield* spawnAndCollect(codexSettings.binaryPath, command); +}); export const checkCodexProviderStatus = Effect.fn("checkCodexProviderStatus")(function* ( resolveAccount?: (input: {