From 944c3adb10b14eaaae086d0696fc36db212c2668 Mon Sep 17 00:00:00 2001 From: Adam Higgins Date: Fri, 30 Oct 2026 09:47:17 +0000 Subject: [PATCH] fix: repair existing checks exposed by upstream sync --- .../Adapters/CodexAdapterV2.test.ts | 5 ++-- .../src/provider/Drivers/ClaudeSkills.test.ts | 4 ++- .../src/provider/Drivers/CodexDriver.ts | 24 +-------------- .../src/textGeneration/TextGeneration.test.ts | 30 +++++++++++-------- apps/server/src/vcs/GitVcsDriverCore.test.ts | 2 +- .../settings/ScheduledTasksSettings.tsx | 2 +- scripts/build-npm-launcher.test.ts | 9 ++++-- 7 files changed, 34 insertions(+), 42 deletions(-) diff --git a/apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.test.ts b/apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.test.ts index 9e9bbfca371a..6a3f3f515a1c 100644 --- a/apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.test.ts +++ b/apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.test.ts @@ -717,7 +717,7 @@ function withReplayRequestId( entry: CodexReplay.CodexAppServerReplayEntry, id: number, ): CodexReplay.CodexAppServerReplayEntry { - return entry.type !== "runtime_exit" && Predicate.isObject(entry.frame) + return entry.type !== "runtime_exit" && Predicate.isObject(entry.frame) && "id" in entry.frame ? { ...entry, frame: { ...entry.frame, id } } : entry; } @@ -1159,7 +1159,7 @@ describe("CodexAdapterV2 post-settle continuation", () => { runtimePolicy: CODEX_TEST_RUNTIME_POLICY, }); const events: Array = []; - const firstTerminal = yield* Deferred.make(); + const firstTerminal = yield* Deferred.make(); yield* runtime.events.pipe( Stream.runForEach((event) => Effect.sync(() => { @@ -1174,6 +1174,7 @@ describe("CodexAdapterV2 post-settle continuation", () => { Effect.andThen(onEvent(event)), ), ), + Effect.catchCause((cause) => Deferred.failCause(firstTerminal, cause)), Effect.forkScoped, ); if (runtime.hasPendingBackgroundWork === undefined) { diff --git a/apps/server/src/provider/Drivers/ClaudeSkills.test.ts b/apps/server/src/provider/Drivers/ClaudeSkills.test.ts index 860280aa91e8..0855d457f1f5 100644 --- a/apps/server/src/provider/Drivers/ClaudeSkills.test.ts +++ b/apps/server/src/provider/Drivers/ClaudeSkills.test.ts @@ -80,7 +80,9 @@ it.layer(NodeServices.layer)("discoverClaudeSkills", (it) => { Effect.gen(function* () { const fs = yield* FileSystem.FileSystem; const path = yield* Path.Path; - const tempDir = yield* fs.makeTempDirectoryScoped({ prefix: "t3-claude-skills-" }); + const tempDir = yield* fs.realPath( + yield* fs.makeTempDirectoryScoped({ prefix: "t3-claude-skills-" }), + ); const configDir = path.join(tempDir, "claude-home"); const workspace = path.join(tempDir, "workspace"); const nestedWorkspace = path.join(workspace, "packages", "app"); diff --git a/apps/server/src/provider/Drivers/CodexDriver.ts b/apps/server/src/provider/Drivers/CodexDriver.ts index 8e29708e8897..eb074b95bd30 100644 --- a/apps/server/src/provider/Drivers/CodexDriver.ts +++ b/apps/server/src/provider/Drivers/CodexDriver.ts @@ -1,26 +1,4 @@ -/** - * CodexDriver — first concrete `ProviderDriver` in the new per-instance model. - * - * A driver is a plain value (not a Context.Service) whose `create()` returns - * one `ProviderInstance` bundling: - * - `snapshot` — the live `ManagedServerProvider` for this instance; - * - `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. - * - * Resource lifecycle: `create()` runs in a scope handed in by the registry. - * Closing that scope releases the adapter's child processes, the managed - * snapshot's refresh fibre, and the text-generation binaries' transient - * scratch files. The registry uses this to tear down an instance when its - * `providerInstances` entry disappears or its config changes. - * - * @module provider/Drivers/CodexDriver - */ +// Each instance owns its Codex home and child processes; the registry owns its scope. import { CodexSettings, ProviderDriverKind, type ServerProvider } from "@t3tools/contracts"; import * as Crypto from "effect/Crypto"; import * as Effect from "effect/Effect"; diff --git a/apps/server/src/textGeneration/TextGeneration.test.ts b/apps/server/src/textGeneration/TextGeneration.test.ts index 1818b749ab6f..522d72bb3d98 100644 --- a/apps/server/src/textGeneration/TextGeneration.test.ts +++ b/apps/server/src/textGeneration/TextGeneration.test.ts @@ -86,11 +86,13 @@ describe("TextGeneration.make", () => { makeStubRegistry([instance]), ), Effect.provide( - Layer.mock(SourceControlProviderRegistry.SourceControlProviderRegistry)({ - resolveLink: () => Effect.die("Supplied context must not be fetched again"), - }), + Layer.mergeAll( + Layer.mock(SourceControlProviderRegistry.SourceControlProviderRegistry)({ + resolveLink: () => Effect.die("Supplied context must not be fetched again"), + }), + ServerSettings.layerTest(), + ), ), - Effect.provide(ServerSettings.layerTest()), ); yield* generation.generateThreadTitle({ cwd: process.cwd(), @@ -131,11 +133,13 @@ describe("TextGeneration.make", () => { makeStubRegistry([personal, work]), ), Effect.provide( - Layer.mock(SourceControlProviderRegistry.SourceControlProviderRegistry)({ - resolveLink: () => Effect.die("No link lookup expected"), - }), + Layer.mergeAll( + Layer.mock(SourceControlProviderRegistry.SourceControlProviderRegistry)({ + resolveLink: () => Effect.die("No link lookup expected"), + }), + ServerSettings.layerTest(), + ), ), - Effect.provide(ServerSettings.layerTest()), ); const result = yield* tg.generateBranchName({ @@ -157,11 +161,13 @@ describe("TextGeneration.make", () => { makeStubRegistry([]), ), Effect.provide( - Layer.mock(SourceControlProviderRegistry.SourceControlProviderRegistry)({ - resolveLink: () => Effect.die("No link lookup expected"), - }), + Layer.mergeAll( + Layer.mock(SourceControlProviderRegistry.SourceControlProviderRegistry)({ + resolveLink: () => Effect.die("No link lookup expected"), + }), + ServerSettings.layerTest(), + ), ), - Effect.provide(ServerSettings.layerTest()), ); const result = yield* tg diff --git a/apps/server/src/vcs/GitVcsDriverCore.test.ts b/apps/server/src/vcs/GitVcsDriverCore.test.ts index df75ac73a20b..dd4b541702fa 100644 --- a/apps/server/src/vcs/GitVcsDriverCore.test.ts +++ b/apps/server/src/vcs/GitVcsDriverCore.test.ts @@ -3743,7 +3743,7 @@ it.layer(layerTest)("GitVcsDriver core integration", (it) => { assert.equal(yield* git(created.worktree.path, ["branch", "--show-current"]), branch); assert.include( yield* git(cwd, ["-c", "core.quotePath=false", "worktree", "list", "--porcelain"]), - `worktree ${created.worktree.path}`, + `worktree ${NodeFS.realpathSync.native(created.worktree.path)}`, ); folders.add(folder); } diff --git a/apps/web/src/components/settings/ScheduledTasksSettings.tsx b/apps/web/src/components/settings/ScheduledTasksSettings.tsx index 4416a1600176..09e78f0524f3 100644 --- a/apps/web/src/components/settings/ScheduledTasksSettings.tsx +++ b/apps/web/src/components/settings/ScheduledTasksSettings.tsx @@ -371,7 +371,7 @@ export function ScheduledTasksSettings(target: { ? { environmentId: pendingDraft.environmentId, task: null, seed: pendingDraft.seed } : null, ); - // The form owns the prefill once open; clearing it keeps a later visit from reopening it. + // oxlint-disable-next-line t3code/no-unreasoned-state-sync -- Consume the external pending-draft atom after the mounted editor takes ownership. useEffect(() => { if (pendingDraft) setPendingScheduledTaskDraft(null); }, [pendingDraft]); diff --git a/scripts/build-npm-launcher.test.ts b/scripts/build-npm-launcher.test.ts index 4c7edd476335..aec749132087 100644 --- a/scripts/build-npm-launcher.test.ts +++ b/scripts/build-npm-launcher.test.ts @@ -139,11 +139,16 @@ it.layer(NodeServices.layer)("build-npm-launcher", (it) => { T3CODE_RELEASE_BASE_URL: release.baseUrl, }; const launcher = path.join(packageDir, "bin/t3.mjs"); + const canonicalLauncher = yield* fs.realPath(launcher); const first = yield* run(process.execPath, [launcher, "serve", "a b"], { cwd: root, env, }); - assert.equal(first.stdout.trim(), `stub serve a b launcher=${launcher}`, first.stderr); + assert.equal( + first.stdout.trim(), + `stub serve a b launcher=${canonicalLauncher}`, + first.stderr, + ); assert.equal(first.exitCode, 7); const versionDir = path.join(home, "runtime/versions", VERSION); assert.equal( @@ -298,7 +303,7 @@ fs.readFileSync = (file, ...rest) => { }); assert.equal( replaced.stdout.trim(), - `stub --version launcher=${launcher}`, + `stub --version launcher=${canonicalLauncher}`, replaced.stderr, ); assert.equal(replaced.exitCode, 7);