Agent web search crashes after scraper/reranker failures with Cannot read properties of undefined (reading 'role')
#12284
-
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
|
Thanks for the detailed report. The search tool's error handling is actually working correctly, scraper/reranker failures are caught at every level and always return valid results. The crash is from the model (MiniMax 2.5 via OpenAI-compatible endpoint) returning an empty stream, which pushes I'm refactoring this area as part of a different effort, and a guard against empty model streams will be included. Moving to discussion since the root cause is provider-side. |
Beta Was this translation helpful? Give feedback.
-
|
@danny-avila I have some users seeing this error with our custom provider. What's a short term fix? Just make sure we don't return an empty stream to LibreChat? |
Beta Was this translation helpful? Give feedback.

Thanks for the detailed report. The search tool's error handling is actually working correctly, scraper/reranker failures are caught at every level and always return valid results. The crash is from the model (MiniMax 2.5 via OpenAI-compatible endpoint) returning an empty stream, which pushes
undefinedinto LangGraph's message state. The correlation with search failures is indirect, degraded tool output may trigger this behavior from certain providers.I'm refactoring this area as part of a different effort, and a guard against empty model streams will be included. Moving to discussion since the root cause is provider-side.