Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): keep Codex SQLite files in shared home #9229

Closedjoe-lloyd(GitHub profile, opens in a new tab)wants to merge 2 commits intomain fromrefs/pull/9229/headopened View on GitHub

Showing 3 changed files with 150 additions and 8 deletions.

x
0 of 3 viewed, 3 left
6 additions and 6 deletionsapps/server/src/provider/Drivers/CodexDriver.tsModified
View file
@@ -7,11 +7,8 @@
* - `adapter` — the Codex session/turn/approval runtime;
* - `textGeneration` — commit/PR/branch/title generation via `codex exec`.
*
- * Each call to `create()` captures the `codexConfig` argument in closures
- * owned by the returned instance. Two instances created with different
- * `homePath`s (e.g. `codex_personal` + `codex_work`) therefore run with
- * fully independent Codex app-server processes and `CODEX_HOME`
- * environments — no shared mutable state.
+ * Each instance owns its app-server process and `CODEX_HOME`. Auth overlays
+ * share session and SQLite state while keeping account credentials private.
* Resource lifecycle: `create()` runs in a scope handed in by the registry.
* Closing that scope releases the adapter's child processes, the managed
@@ -112,8 +109,11 @@
const serverSettings = yield* ServerSettingsService;
const eventLoggers = yield* ProviderEventLoggers;
const modelManifest = yield* ModelManifest.ModelManifest;
- const processEnv = mergeProviderInstanceEnvironment(environment);
+ let processEnv = mergeProviderInstanceEnvironment(environment);
const homeLayout = yield* resolveCodexHomeLayout(config);
+ if (homeLayout.mode === "authOverlay") {
+ processEnv = { ...processEnv, CODEX_SQLITE_HOME: homeLayout.sharedHomePath };
+ }
const continuationIdentity = codexContinuationIdentity(homeLayout);
const stampIdentity = withInstanceIdentity({
instanceId,