From 6d9b21c5d042ff992b26493563096459cb9158ac Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Wed, 1 Apr 2026 08:56:04 -0700 Subject: [PATCH] [codex] migrate Effect.fn in apps/server/src/provider/Layers/CodexProvider.ts (#1635) 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 499d4c6ffdcd84f241f55e912e3889279ebdf644..667bdf048bf60fee336bca836b3bbdfa61426210 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: { -- 2.54.0