| ... | @@ -306,21 +306,20 @@ const probeCodexCapabilities = (input: { | ... | @@ -306,21 +306,20 @@ const probeCodexCapabilities = (input: { |
| 306 | }), | 306 | }), |
| 307 | ); | 307 | ); |
| 308 | | 308 | |
| 309 | const runCodexCommand = (args: ReadonlyArray<string>) => | 309 | const 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 | }); |
| 324 | | 323 | |
| 325 | export const checkCodexProviderStatus = Effect.fn("checkCodexProviderStatus")(function* ( | 324 | export const checkCodexProviderStatus = Effect.fn("checkCodexProviderStatus")(function* ( |
| 326 | resolveAccount?: (input: { | 325 | resolveAccount?: (input: { |