summaryrefslogtreecommitdiff
path: root/frontend/src/components/LeftSidebar.tsx
diff options
context:
space:
mode:
authorYurenHao0426 <blackhao0426@gmail.com>2026-02-14 03:40:31 +0000
committerYurenHao0426 <blackhao0426@gmail.com>2026-02-14 03:40:31 +0000
commitbdf381a2c8a0337f7459000f487a80f9cbbbdd2f (patch)
treeb3c72c85f3e7c47b4c98a1301acc7fa7d23a6d05 /frontend/src/components/LeftSidebar.tsx
parentded75a5c19ad4aa8dc832fc4c138b68093e22ee8 (diff)
Add background task persistence for debate & council operations
Decouple debate/council execution from SSE connection lifecycle so tasks survive browser disconnects. Backend runs work as asyncio.Tasks with progressive disk persistence; frontend can reconnect and recover state. - New backend/app/services/tasks.py: task registry, broadcast pattern, disk persistence at milestones, stale task cleanup on startup - New endpoints: POST start_debate/start_council, GET task stream/poll - Frontend stores taskId on nodes, recovers running tasks on page load - _applyPartialEvents rebuilds stage text + data from accumulated events Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'frontend/src/components/LeftSidebar.tsx')
-rw-r--r--frontend/src/components/LeftSidebar.tsx3
1 files changed, 3 insertions, 0 deletions
diff --git a/frontend/src/components/LeftSidebar.tsx b/frontend/src/components/LeftSidebar.tsx
index 54c2527..441b7e0 100644
--- a/frontend/src/components/LeftSidebar.tsx
+++ b/frontend/src/components/LeftSidebar.tsx
@@ -30,6 +30,7 @@ const LeftSidebar: React.FC<LeftSidebarProps> = ({ isOpen, onToggle }) => {
deleteFile,
readBlueprintFile,
loadBlueprint,
+ recoverBackgroundTasks,
saveBlueprintFile,
saveCurrentBlueprint,
createProjectFolder,
@@ -266,6 +267,8 @@ const LeftSidebar: React.FC<LeftSidebarProps> = ({ isOpen, onToggle }) => {
if (vp) {
setViewport(vp);
}
+ // Recover any background tasks that were running before page refresh
+ recoverBackgroundTasks();
} catch (e) {
console.error(e);
alert('Not a valid blueprint JSON.');