fix: handle missing message in assistant generation telemetry (#6528)

This commit is contained in:
Thomas authored and GitHub committed 2026-08-07 14:59:59 +02:00
1 parent 6bbb786ede
commit b14756874e
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -738,7 +738,7 @@ export const assistantRouter = createTRPCRouter({
}),
getConfigurationAsync(ctx.db),
]);
if (!message) throw new TRPCError({ code: "NOT_FOUND", message: "Message not found." });
if (!message) return { complete: true, generations: [] };
if (configuration?.provider !== "openrouter" || !configuration.encryptedApiKey) {
return { complete: true, generations: [] };
}