fix: the frontend error when cancle the research plan (#719)

Co-authored-by: Willem Jiang <143703838+willem-bd@users.noreply.github.com>
This commit is contained in:
Willem Jiang
2025-11-28 08:35:42 +08:00
committed by GitHub
parent 4559197505
commit 223ec57fe4

View File

@@ -487,6 +487,11 @@ async def _stream_graph_events(
yield event
logger.debug(f"[{safe_thread_id}] Graph event stream completed. Total events: {event_count}")
except asyncio.CancelledError:
# User cancelled/interrupted the stream - this is normal, not an error
logger.info(f"[{safe_thread_id}] Graph event stream cancelled by user after {event_count} events")
# Re-raise to signal cancellation properly without yielding an error event
raise
except Exception as e:
logger.exception(f"[{safe_thread_id}] Error during graph execution")
yield _make_event(