diff --git a/packages/server/src/utils/buildAgentGraph.ts b/packages/server/src/utils/buildAgentGraph.ts index 3b9c94d2d43..c0e8d7a60dc 100644 --- a/packages/server/src/utils/buildAgentGraph.ts +++ b/packages/server/src/utils/buildAgentGraph.ts @@ -325,7 +325,7 @@ export const buildAgentGraph = async ( // Send loading next agent indicator if (reasoning.next && reasoning.next !== 'FINISH' && reasoning.next !== 'END') { if (sseStreamer) { - sseStreamer.streamNextAgentEvent(chatId, mapNameToLabel[reasoning.next].label || reasoning.next) + sseStreamer.streamNextAgentEvent(chatId, mapNameToLabel[reasoning.next]?.label || reasoning.next) } } } diff --git a/packages/server/src/utils/buildChatflow.ts b/packages/server/src/utils/buildChatflow.ts index 61a69325bac..dd85dc98b93 100644 --- a/packages/server/src/utils/buildChatflow.ts +++ b/packages/server/src/utils/buildChatflow.ts @@ -218,7 +218,7 @@ export const utilBuildChatflow = async (req: Request, isInternal: boolean = fals /*** Get session ID ***/ const memoryNode = findMemoryNode(nodes, edges) - const memoryType = memoryNode?.data.label + const memoryType = memoryNode?.data?.label let sessionId = getMemorySessionId(memoryNode, incomingInput, chatId, isInternal) /*** Get Ending Node with Directed Graph ***/