Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): prevent silent session forks when switching provider accounts #6148

ClosedDavidIlie(GitHub profile, opens in a new tab)wants to merge 3 commits intomain fromrefs/pull/6148/headopened View on GitHub

Showing 5 changed files with 79 additions and 58 deletions (loading 3).

x
0 of 5 viewed, 5 left
69 additions and 0 deletionsapps/server/src/orchestration/Layers/ProviderCommandReactor.test.tsModified
View file
@@ -2448,6 +2448,75 @@
+ it("surfaces a stopped-session restart failure without binding a replacement", async () => {
+ const harness = await createHarness({
+ startSessionEffect: () =>
+ Effect.fail(
+ new ProviderAdapterRequestError({
+ provider: "codex",
+ method: "startSession",
+ detail: "Persisted provider resume state is incompatible with the requested instance.",
+ }),
+ ),
+ });
+ const now = "2026-01-01T00:00:00.000Z";
+​
+ await Effect.runPromise(
+ harness.engine.dispatch({
+ type: "thread.session.set",
+ commandId: CommandId.make("cmd-session-set-stopped-restart-failure"),
+ threadId: ThreadId.make("thread-1"),
+ session: {
+ threadId: ThreadId.make("thread-1"),
+ status: "stopped",
+ providerName: "codex",
+ providerInstanceId: ProviderInstanceId.make("codex"),
+ runtimeMode: "approval-required",
+ activeTurnId: null,
+ lastError: null,