Fix stop signal handling and Sider streaming wrapper

This commit is contained in:
Jiaqing Liang
2026-02-06 10:39:36 +08:00
parent b37b56a780
commit de0cce72e0
3 changed files with 6 additions and 8 deletions

View File

@@ -85,8 +85,7 @@ class GeneraticAgent:
try:
full_response = ""; last_pos = 0
for chunk in gen:
if self.stop_sig:
self.abort(); break
if self.stop_sig: break
full_response += chunk
if len(full_response) - last_pos > 50:
self.display_queue.put({'next': f'{full_response}', 'source': source})
@@ -103,4 +102,6 @@ class GeneraticAgent:
self.stop_sig = False
self.current_source = 'none'
self.task_queue.task_done()
if self.handler is not None: self.handler.code_stop_signal.append(1)