We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a70a5dc commit 21d6303Copy full SHA for 21d6303
1 file changed
packages/server/api/src/app/ai/chat/ai-mcp-chat.controller.ts
@@ -225,11 +225,14 @@ export const aiMCPChatController: FastifyPluginAsyncTypebox = async (app) => {
225
try {
226
await handleNewMessage(request, reply);
227
} finally {
228
- // Flush traces to Langfuse (critical for Fastify)
229
const spanProcessor = getLangfuseSpanProcessor();
230
if (spanProcessor) {
231
- await spanProcessor.forceFlush();
232
- logger.debug('Flushed Langfuse traces');
+ try {
+ await spanProcessor.forceFlush();
+ logger.debug('Flushed Langfuse traces');
233
+ } catch (error) {
234
+ logger.error('Failed to flush Langfuse traces', { error });
235
+ }
236
}
237
238
});
0 commit comments