Skip to content

fix(graph): keep dashboard synchronized after lead settles - #1108

Closed
SparkHello wants to merge 1 commit into
KunAgent:developfrom
SparkHello:fix/1072-graph-runtime-sync
Closed

fix(graph): keep dashboard synchronized after lead settles#1108
SparkHello wants to merge 1 commit into
KunAgent:developfrom
SparkHello:fix/1072-graph-runtime-sync

Conversation

@SparkHello

Copy link
Copy Markdown

背景

这是对 #1072 以及 v0.2.35 快照轮询实现的正确性补强。

Graph 的 SSE 实时事件可能漏送;同时,面板切换线程时存在短暂窗口,旧线程的投影可能被画到新线程下。同步状态本身也不应决定是否停止可靠性兜底。

修改

  • 保留 5 秒持久化快照轮询,并与 SSE 实时更新并行工作。
  • 非终态运行、活跃规划草稿或活跃 Graph 来源轮次始终允许静默快照回补。
  • 刷新保持 single-flight,隐藏面板后停止。
  • syncStatus 仅用于连接状态展示,不再参与轮询决策。
  • 增加线程 ownership render gate,防止把线程 A 的 Graph 投影显示在线程 B。
  • 新增独立 thread observer 与 hook 测试。

验证

  • graph-store:22 pass
  • graph-thread-observer:4 pass
  • use-graph-thread-observer:5 pass
  • use-graph-parent-observer:2 pass
  • GraphModePanel:16 pass
  • chat-store-thread-actions:54 pass
  • 合计:103 pass
  • npm run typecheck:通过
  • git diff --check:通过

Refs #1072

Add an independent Graph SSE observer while preserving the v0.2.35 five-second durable snapshot fallback. Keep thread cursors and projections owner-scoped, coalesce refreshes, reconnect after stream loss, and prevent cross-thread rendering.

Refs KunAgent#1072
@XingYu-Zhong
XingYu-Zhong changed the base branch from master to develop August 7, 2026 14:16
@XingYu-Zhong

Copy link
Copy Markdown
Collaborator

Retargeted base from master to develop.

#1072’s 5s silent snapshot polling is already on develop. The remaining value is the thread-ownership / graph-thread-observer hardening. Currently CONFLICTING against develop — needs rebase on the fork before it can merge.

@XingYu-Zhong

Copy link
Copy Markdown
Collaborator

Superseded by #1128, which ports the ownership/observer hardening onto current develop (including the graph-store-types split).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants