Fix 'label' undefined errors for sequential agents #3585
+2
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Simple Flow: Follow part of video on sequential flows until 9:15 where LLM Node setup is complete.
https://www.youtube.com/watch?v=3ZmBq8_4vCs&list=PL4HikwTaYE0H7wBxhvQqxYcKOkZ4O3zXh
Stack trace:
Error: Cannot read properties of undefined (reading 'label') flowise:dev: at buildAgentGraph (\Flowise\packages\server\dist\utils\buildAgentGraph.js:402:19) flowise:dev: at async utilBuildAgentResponse (\Flowise\packages\server\dist\utils\buildChatflow.js:435:31) flowise:dev: at async utilBuildChatflow (\Flowise\packages\server\dist\utils\buildChatflow.js:198:20) flowise:dev: at async createAndStreamInternalPrediction (\Flowise\packages\server\dist\controllers\internal-predictions\index.js:33:29) flowise:dev: 2024-11-26 13:50:21 [ERROR]: [server]: Error: Error buildAgentGraph - Cannot read properties of undefined (reading 'label') flowise:dev: Error: Error buildAgentGraph - Cannot read properties of undefined (reading 'label') flowise:dev: at buildAgentGraph (\Flowise\packages\server\dist\utils\buildAgentGraph.js:408:15) flowise:dev: at async utilBuildAgentResponse (\Flowise\packages\server\dist\utils\buildChatflow.js:435:31) flowise:dev: at async utilBuildChatflow (\Flowise\packages\server\dist\utils\buildChatflow.js:198:20) flowise:dev: at async createAndStreamInternalPrediction (\Flowise\packages\server\dist\controllers\internal-predictions\index.js:33:29) flowise:dev: 2024-11-26 13:50:21 [ERROR]: [server]: Error: Error buildAgentGraph - Cannot read properties of undefined (reading 'label') flowise:dev: Error: Error buildAgentGraph - Cannot read properties of undefined (reading 'label') flowise:dev: at utilBuildAgentResponse (\Flowise\packages\server\dist\utils\buildChatflow.js:541:15) flowise:dev: at async utilBuildChatflow (\Flowise\packages\server\dist\utils\buildChatflow.js:198:20) flowise:dev: at async createAndStreamInternalPrediction (\Flowise\packages\server\dist\controllers\internal-predictions\index.js:33:29)
Commit adds some optional chaining around 2 reads of 'label' property.
Without this change some usage of sequential agents requires a memory node to not hit a runtime error when trying to access 'label'.