Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(codex): use project cwd for skill discovery #2330

ClosedDerpedyea(GitHub profile, opens in a new tab)wants to merge 13 commits intomain fromrefs/pull/2330/headopened View on GitHub

Showing 2 changed files with 28 additions and 1 deletion.

x
0 of 2 viewed, 2 left
6 additions and 1 deletionapps/server/src/provider/Layers/CodexProvider.tsModified
View file
@@ -24,6 +24,7 @@
import { createModelCapabilities } from "@t3tools/shared/model";
import { buildServerProvider, type ServerProviderDraft } from "../providerSnapshot.ts";
import { expandHomePath } from "../../pathExpansion.ts";
+import { ServerConfig } from "../../config.ts";
import { scopedSafeTeardown } from "./scopedSafeTeardown.ts";
import packageJson from "../../../package.json" with { type: "json" };
const isCodexAppServerSpawnError = Schema.is(CodexErrors.CodexAppServerSpawnError);
@@ -421,6 +422,7 @@
ServerSettingsError,
ChildProcessSpawner.ChildProcessSpawner
> {
+ const serverConfig = yield* Effect.serviceOption(ServerConfig);
const checkedAt = DateTime.formatIso(yield* DateTime.now);
const emptyModels = emptyCodexModelsFromSettings(codexSettings);
​
@@ -444,7 +446,10 @@
const probeResult = yield* probe({
binaryPath: codexSettings.binaryPath,
homePath: codexSettings.homePath,
- cwd: process.cwd(),
+ cwd: Option.match(serverConfig, {
+ onNone: () => process.cwd(),
+ onSome: (config) => config.cwd,
+ }),
customModels: codexSettings.customModels,
environment,
}).pipe(Effect.timeoutOption(Duration.millis(PROVIDER_PROBE_TIMEOUT_MS)), Effect.result);