Set failed response message when a research iteration fails.

Previously summarizedResult would be unset when a tool call failed.

This caused research to fail due to ChatMessageModel failures when
constructing tool chat histories and would have caused similar errors
in other constructed chat histories.

Putting a failed iteration message in the summary prevents that while
letting the research agent continue its research.
This commit is contained in:
Debanjum
2025-06-20 14:13:50 -07:00
parent b85c646611
commit 623c8b65f1

View File

@@ -499,5 +499,6 @@ async def research(
# intermediate_result = await extract_relevant_info(this_iteration.query, results_data, agent)
this_iteration.summarizedResult = results_data
this_iteration.summarizedResult = this_iteration.summarizedResult or "Failed to get results."
previous_iterations.append(this_iteration)
yield this_iteration