Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): fail V2 runs when provider sessions cannot open #12790

Mergedpbember(GitHub profile, opens in a new tab)merged 2 commits intot3code/codex-turn-mapping fromrefs/pull/12790/headmerged by juliusmarminge View on GitHub

Showing 2 changed files with 153 additions and 18 deletions (loading 1).

x
0 of 2 viewed, 2 left
153 additions and 18 deletionsapps/server/src/orchestration-v2/ProviderTurnStartService.test.tsModified
View file
@@ -16,6 +16,7 @@
type OrchestrationV2ThreadProjection,
OrchestrationV2DomainEvent,
} from "@t3tools/contracts";
+import * as Cause from "effect/Cause";
import * as DateTime from "effect/DateTime";
import * as Effect from "effect/Effect";
import * as FileSystem from "effect/FileSystem";
@@ -153,6 +154,10 @@
readonly previousNativeSession?: boolean;
readonly previousMessages?: ReadonlyArray<string>;
readonly logoutFailure?: string;
+ readonly openFailure?: unknown;
+ readonly interruptOpen?: boolean;
+ readonly interruptRunBeforeOpenFailure?: boolean;
+ readonly writeFailure?: unknown;
}) {
const now = DateTime.makeUnsafe("2026-09-04T12:00:00Z");
const threadId = ThreadId.make("thread-native-account-command");
@@ -325,7 +330,34 @@
updatedAt: now,
const events: Array<OrchestrationV2DomainEvent> = [];
- const open = vi.fn(() => Effect.die("A local command must not open a native session."));
+ const open = vi.fn(() =>
+ input.interruptOpen === true
+ ? Effect.interrupt
+ : "openFailure" in input