From 2ee6b90c997825141425f2b39a8b47b3ecf5b8ce Mon Sep 17 00:00:00 2001 From: Lucas Smith Date: Thu, 4 Dec 2025 10:03:29 +1100 Subject: [PATCH] fix: add debug logging for ai streaming (#2275) --- apps/remix/server/api/ai/detect-fields.ts | 4 ++++ apps/remix/server/api/ai/detect-recipients.ts | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/apps/remix/server/api/ai/detect-fields.ts b/apps/remix/server/api/ai/detect-fields.ts index 76620ce47..6571569f0 100644 --- a/apps/remix/server/api/ai/detect-fields.ts +++ b/apps/remix/server/api/ai/detect-fields.ts @@ -116,6 +116,10 @@ export const detectFieldsRoute = new Hono().post( clearInterval(interval); } + // The logger below it stringifies the error, using `console.error` + // to attempt to get a stack trace + console.error(error); + logger.error({ event: 'ai.detect-fields.error', error, diff --git a/apps/remix/server/api/ai/detect-recipients.ts b/apps/remix/server/api/ai/detect-recipients.ts index 353036ed6..7ffb809c4 100644 --- a/apps/remix/server/api/ai/detect-recipients.ts +++ b/apps/remix/server/api/ai/detect-recipients.ts @@ -114,6 +114,10 @@ export const detectRecipientsRoute = new Hono().post( clearInterval(interval); } + // The logger below it stringifies the error, using `console.error` + // to attempt to get a stack trace + console.error(error); + logger.error({ event: 'ai.detect-recipients.error', error,