Skip to content

Open source CapCut alternative.

TypeScript

fix(site): a cancelled judgment is not a provider failure

David Lea873367f4ce7
diff --git a/site/src/app/api/inference/judge/route.ts b/site/src/app/api/inference/judge/route.ts
index 822ecbd6..225d9e52 100644
--- a/site/src/app/api/inference/judge/route.ts
+++ b/site/src/app/api/inference/judge/route.ts
@@ -89,6 +89,11 @@ export const POST = withDonkeyAuth(async (request) => {
},
});
} catch (error) {
+ // A caller that went away — a stopped or superseded turn — is not a
+ // provider failure: it bills nothing and records nothing.
+ if (request.signal.aborted) {
+ return new NextResponse(null, { status: 499 });
+ }
if (!bypassCredits) {
await recordFailedInferenceUsage({
clientId: client.clientId,