fix: handle undefined follow_up_queries in reflection event

Add optional chaining and fallback value to prevent TypeError when
event.reflection.follow_up_queries is undefined in onUpdateEvent handler.
This commit is contained in:
Yishen Tu
2025-06-13 23:28:31 +08:00
parent cf240a2c85
commit a59a1981bd

View File

@@ -54,9 +54,9 @@ export default function App() {
title: "Reflection",
data: event.reflection.is_sufficient
? "Search successful, generating final answer."
: `Need more information, searching for ${event.reflection.follow_up_queries.join(
: `Need more information, searching for ${event.reflection.follow_up_queries?.join(
", "
)}`,
) || "additional information"}`,
};
} else if (event.finalize_answer) {
processedEvent = {