Skip to content

Commit c19da29

Browse files
committed
fix: final cut summary
Signed-off-by: royalpinto007 <[email protected]>
1 parent cbb47fc commit c19da29

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

backend/director/core/reasoning.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,10 @@ def step(self):
291291
self.summary_content.text = llm_response.content
292292
self.summary_content.status = MsgStatus.success
293293
else:
294+
self.summary_content.text = (
295+
self.summary_content.text + llm_response.content
296+
if self.summary_content.text else llm_response.content
297+
)
294298
self.session.reasoning_context.append(
295299
ContextMessage(
296300
content=SUMMARIZATION_PROMPT.format(
@@ -306,7 +310,11 @@ def step(self):
306310
]
307311
)
308312
self.session.reasoning_context.pop()
309-
self.summary_content.text = summary_response.content
313+
if summary_response.content not in self.summary_content.text:
314+
self.summary_content.text += (
315+
f"\n{summary_response.content}"
316+
if self.summary_content.text else summary_response.content
317+
)
310318
if self.failed_agents:
311319
self.summary_content.status = MsgStatus.error
312320
else:

0 commit comments

Comments
 (0)