Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
50ea343
fix(server): keep Codex shadow SQLite state together
nkcbuilds Nov 2, 2026
f3d14d2
fix(server): reject legacy Codex SQLite links
nkcbuilds Nov 2, 2026
ec97c0f
Merge branch 'main' into fix/codex-sqlite-wal-local
nkcbuilds Nov 3, 2026
a09bf0e
test(server): fix Codex SQLite regression setup
nkcbuilds Nov 3, 2026
88f5927
test(server): cover Codex SQLite recovery across hosts
nkcbuilds Nov 3, 2026
605a0a3
Merge branch 'main' into fix/codex-sqlite-wal-local
nkcbuilds Nov 3, 2026
0e75241
Merge branch 'main' into fix/codex-sqlite-wal-local
nkcbuilds Nov 3, 2026
12f41b5
Merge branch 'main' into fix/codex-sqlite-wal-local
nkcbuilds Nov 6, 2026
0dc5a54
fix(server): read host env via HostProcess in Codex SQLite test
nkcbuilds Nov 6, 2026
efc11f7
fix(server): keep Codex SQLite state safe in provider terminals
nkcbuilds Nov 8, 2026
42df5a9
Merge remote-tracking branch 'origin/main' into fix/codex-sqlite-wal-…
nkcbuilds Nov 8, 2026
efc1780
test(server): guard Codex shadow tests when symlinks are unavailable
nkcbuilds Nov 8, 2026
ff1b573
Merge branch 'main' into fix/codex-sqlite-wal-local
nkcbuilds Nov 8, 2026
74de9b2
Merge remote-tracking branch 'origin/main' into fix/codex-sqlite-wal-…
juliusmarminge Nov 12, 2026
9c28bf4
fix(server): accept inert legacy Codex SQLite links and trim scope
juliusmarminge Nov 12, 2026
ac7db46
fix(server): refuse only a Codex database present in both homes
juliusmarminge Nov 12, 2026
50cfd72
fix(server): keep private Codex databases when the shared home has ot…
juliusmarminge Nov 12, 2026
e38804a
Merge remote-tracking branch 'origin/main' into fix/codex-sqlite-wal-…
nkcbuilds Nov 13, 2026
4442692
fix(server): refuse mixed Codex SQLite homes on Windows instead of li…
nkcbuilds Nov 13, 2026
ddf3674
fix(server): give shadow terminals the instance environment's CODEX_HOME
nkcbuilds Nov 13, 2026
3001024
Merge remote-tracking branch 'upstream/main' into fix/codex-sqlite-wa…
nkcbuilds Nov 13, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 18 additions & 11 deletions apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1781,17 +1781,24 @@ export const createCodexAdapterV2 = Effect.fn("CodexAdapterV2.createCodexAdapter
const serverConfig = yield* ServerConfig;
const homeLayout = yield* resolveCodexHomeLayout(config);

yield* materializeCodexShadowHome(homeLayout).pipe(
Effect.mapError(
(cause) =>
new ProviderAdapterDriverCreateError({
driver: CODEX_DRIVER_KIND,
instanceId,
detail: "Failed to materialize the Codex shadow home.",
cause,
}),
),
const environmentOverrides = yield* mergeProviderInstanceEnvironment(
environment,
hostEnvironment,
);
const processEnv =
hooks.resolveRuntime === undefined
? yield* materializeCodexShadowHome(homeLayout, environmentOverrides).pipe(
Effect.mapError(
(cause) =>
new ProviderAdapterDriverCreateError({
driver: CODEX_DRIVER_KIND,
instanceId,
detail: "Failed to prepare the Codex shadow home.",
cause,
}),
),
)
: environmentOverrides;

const settings = {
...config,
Expand All @@ -1803,7 +1810,7 @@ export const createCodexAdapterV2 = Effect.fn("CodexAdapterV2.createCodexAdapter
return yield* makeCodexAdapterV2({
instanceId,
settings,
environment: yield* mergeProviderInstanceEnvironment(environment, hostEnvironment),
environment: processEnv,
clientFactory,
digest,
fileSystem,
Expand Down
5 changes: 3 additions & 2 deletions apps/server/src/provider/CodexManagedRuntime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export const makeCodexManagedRuntime = Effect.fn("makeCodexManagedRuntime")(func
environmentId,
profileKey,
]);
yield* materializeCodexShadowHome(homeLayout).pipe(
const homeEnvironment = yield* materializeCodexShadowHome(homeLayout, options.environment).pipe(
Effect.provideService(FileSystem.FileSystem, fs),
Effect.provideService(Path.Path, path),
Effect.mapError(
Expand All @@ -100,6 +100,7 @@ export const makeCodexManagedRuntime = Effect.fn("makeCodexManagedRuntime")(func
instanceId: options.instanceId,
operation: "runtime",
detail: cause.message,
cause,
}),
),
);
Expand All @@ -115,7 +116,7 @@ export const makeCodexManagedRuntime = Effect.fn("makeCodexManagedRuntime")(func
);
// Ambient CLI overrides cannot redirect a T3-owned token to a different provider.
const environment: NodeJS.ProcessEnv = {
...options.environment,
...homeEnvironment,
CODEX_HOME: homePath,
};
delete environment.ACCESS_TOKEN;
Expand Down
6 changes: 3 additions & 3 deletions apps/server/src/provider/Drivers/CodexDriver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,11 @@ export const CodexDriver: ProviderDriver<
const installation = yield* CodexInstallation.CodexInstallation;
const modelCatalog = yield* ModelCatalog.ModelCatalog;
const currentCatalog = modelCatalog.current(DRIVER_KIND);
const processEnv = yield* mergeProviderInstanceEnvironment(
const environmentOverrides = yield* mergeProviderInstanceEnvironment(
environment,
yield* HostProcess.Environment,
);
const environmentHome = processEnv.CODEX_HOME;
const environmentHome = environmentOverrides.CODEX_HOME;
const homeConfig =
!config.homePath.trim() && environmentHome?.trim()
? { ...config, homePath: environmentHome }
Expand All @@ -203,7 +203,7 @@ export const CodexDriver: ProviderDriver<
accentColor,
continuationGroupKey: continuationIdentity.continuationKey,
});
yield* materializeCodexShadowHome(homeLayout).pipe(
const processEnv = yield* materializeCodexShadowHome(homeLayout, environmentOverrides).pipe(
Effect.mapError(
(cause) =>
new ProviderDriverError({
Expand Down
Loading
Loading