@devries-cameron20 / t3code Mirror · read-only / commits / f3b0194c7b
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 22, 12:00 UTC

fix(server): show readable provider runtime failure banners (#24614)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: AdEx-Partners-DE <stark.burns@adexpartners.com>

Julius Marminge committed Oct 29, 2026 at 22:09 UTC f3b0194c7b43251791e9732323d5098a5823cd26
2 files changed +12 -1
apps/server/src/orchestration-v2/ProviderSessionManager.test.ts
+4
@@ -2551,6 +2551,10 @@ it.effect("ProviderSessionManagerV2 releases sessions when provider event stream
2551 assert.isTrue(Option.isNone(liveSession));
2552 assert.equal(runtimeState.closeCount, 1);
2553 assert.equal(projection.providerSessions.at(-1)?.status, "error");
2554 + assert.equal(
2555 + projection.providerSessions.at(-1)?.lastError,
2556 + "The provider event stream closed unexpectedly. Retry the turn; if it keeps failing, check the provider and server logs.",
2557 + );
2558 });
2559
2560 yield* effect.pipe(
apps/server/src/orchestration-v2/ProviderSessionManager.ts
+8 -1
@@ -50,6 +50,7 @@ import * as CommandOutputHub from "./CommandOutputHub.ts";
50 import * as IdAllocator from "@t3tools/provider-core/server/IdAllocator";
51 import * as ProviderEventIngestor from "./ProviderEventIngestor.ts";
52 import * as ProviderAdapter from "@t3tools/provider-core/server/ProviderAdapter";
53 +import { makeProviderFailure } from "@t3tools/provider-core/server/failure";
54 import * as ProviderAdapterRegistry from "./ProviderAdapterRegistry.ts";
55 import * as ProjectionStore from "./ProjectionStore.ts";
56
@@ -1987,10 +1988,16 @@ export const layerWithOptions = (
1988 cause,
1989 });
1990 yield* Ref.set(entry.eventSubscribers, new Map());
1991 + // lastError is the thread banner, so it gets the same bounded
1992 + // message as a failed turn; the raw cause survives only in the log.
1993 + yield* Effect.logWarning("orchestration-v2.provider-session-runtime-failed", {
1994 + providerSessionId: entry.runtime.providerSessionId,
1995 + cause,
1996 + });
1997 yield* releaseEntry({
1998 providerSessionId: entry.runtime.providerSessionId,
1999 reason: "runtime_error",
1993 - detail: Cause.pretty(cause),
2000 + detail: makeProviderFailure({ cause }).message,
2001 }).pipe(logReleaseFailure(entry.runtime.providerSessionId));
2002 }),
2003 ),