Fix 'label' undefined errors for sequential agents (#3585)

Fix 'label' undefined errors

Commit adds some optional chaining around 2 reads of 'label'
property.
This commit is contained in:
Aaron McIntyre
2024-11-27 15:27:49 -08:00
committed by GitHub
parent c50c7bdcce
commit 126808b62a
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -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)
}
}
}