diff --git a/web/src/layouts/ChatLayout/ChatLayoutContext/helpers/assetParamsToRoute.test.ts b/web/src/layouts/ChatLayout/ChatLayoutContext/helpers/assetParamsToRoute.test.ts index 6f7c978b6..0466cd087 100644 --- a/web/src/layouts/ChatLayout/ChatLayoutContext/helpers/assetParamsToRoute.test.ts +++ b/web/src/layouts/ChatLayout/ChatLayoutContext/helpers/assetParamsToRoute.test.ts @@ -503,4 +503,21 @@ describe('assetParamsToRoute', () => { }) ); }); + + test('reasoning messaged with chatid', () => { + const test = { + assetId: '06d9d8b7-eb96-59af-9a03-0436205b60a9', + type: 'reasoning', + chatId: 'chat-123' + } as const; + + const result = assetParamsToRoute(test); + expect(result).toBe( + createBusterRoute({ + route: BusterRoutes.APP_CHAT_ID_REASONING_ID, + chatId: test.chatId, + messageId: test.assetId + }) + ); + }); }); diff --git a/web/src/layouts/ChatLayout/ChatLayoutContext/helpers/assetParamsToRoute.ts b/web/src/layouts/ChatLayout/ChatLayoutContext/helpers/assetParamsToRoute.ts index f3879915a..8a0245583 100644 --- a/web/src/layouts/ChatLayout/ChatLayoutContext/helpers/assetParamsToRoute.ts +++ b/web/src/layouts/ChatLayout/ChatLayoutContext/helpers/assetParamsToRoute.ts @@ -144,6 +144,24 @@ const createDashboardRoute = ({ }); }; +const createReasoningRoute = ({ + messageId, + chatId +}: { + messageId: string; + chatId: string | undefined; +}) => { + if (!chatId) { + return undefined; + } + + return createBusterRoute({ + route: BusterRoutes.APP_CHAT_ID_REASONING_ID, + chatId, + messageId + }); +}; + export const assetParamsToRoute = ({ chatId, assetId, @@ -169,6 +187,13 @@ export const assetParamsToRoute = ({ }); } + if (type === 'reasoning') { + return createReasoningRoute({ + messageId: assetId, + chatId + }); + } + console.warn('Asset params to route has not been implemented for this file type', type); return ''; };