Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): a provider session that fails at runtime no longer puts a stack trace in the thread banner #19097

ClosedAdEx-Partners-DE(GitHub profile, opens in a new tab)wants to merge 4 commits intomain fromrefs/pull/19097/headopened View on GitHub

Showing 2 changed files with 12 additions and 1 deletion.

x
0 of 2 viewed, 2 left
4 additions and 0 deletionsapps/server/src/orchestration-v2/ProviderSessionManager.test.tsModified
View file
@@ -3531,6 +3531,10 @@
assert.isTrue(Option.isNone(liveSession));
assert.equal(runtimeState.closeCount, 1);
assert.equal(projection.providerSessions.at(-1)?.status, "error");
+ assert.equal(
+ projection.providerSessions.at(-1)?.lastError,
+ "The provider event stream closed unexpectedly. Retry the turn; if it keeps failing, check the provider and server logs.",
+ );
yield* effect.pipe(
8 additions and 1 deletionapps/server/src/orchestration-v2/ProviderSessionManager.tsModified
View file
@@ -50,6 +50,7 @@
import * as IdAllocator from "@t3tools/provider-core/server/IdAllocator";
import * as ProviderEventIngestor from "./ProviderEventIngestor.ts";
import * as ProviderAdapter from "@t3tools/provider-core/server/ProviderAdapter";
+import { makeProviderFailure } from "@t3tools/provider-core/server/failure";
import * as ProviderAdapterRegistry from "./ProviderAdapterRegistry.ts";
import * as ProjectionStore from "./ProjectionStore.ts";
​
@@ -2023,10 +2024,16 @@
cause,
yield* Ref.set(entry.eventSubscribers, new Map());
+ // lastError is the thread banner, so it gets the same bounded
+ // message as a failed turn; the raw cause survives only in the log.