fix: panel dock frozen after page refresh — barrier rejects every new fence - #5
Merged
Merged
Conversation
… fence The host's anchor key is `<kindLen>:<kind><id>` (`14:assistant-step3:0`); `anchorSeqOf` grabbed the FIRST number in the key — the kind-name length constant — so every assistant step yielded the same order[0]. The panel store's persisted replay barrier (hydration sets replayBarrier = persisted maxSeenSeq = that constant) then rejected every new panel:true fence after a refresh. Dock froze on the old snapshot, actions kept working, zero logs (issue #4). - anchorSeqOf: parse `<turn>:<step>` from assistant-step keys → seq = turn*1000+step, strictly monotonic in message order and growing across reloads; document-order fallback kept for non-assistant / anchor-less (Safari) rows. Also un-freezes the /panel local-override barrier, which depended on the same broken seq. - Diagnostics: one-time console.warn per source per page session when a barrier rejects an op ([genui] prefix, values included); budget-overflow rejections stay on the existing budget diagnostic. Closes #4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #4 — 页面刷新后面板 dock 冻结,新 panel:true 围栏被持久化重放屏障静默拒绝。
根因(与 issue 排查一致,已在宿主源码证实)
宿主 anchor key 格式 =
conversationContextKey(kind, id)=${kind长度}:${kind}${id};assistant step 的 id 是${turn}:${step}→ 完整 key 如14:assistant-step3:0。DOM 通道anchorSeqOf旧实现取 key 里第一个数字 = kind 名称长度常量(assistant-step=14,所有消息相同)→ 面板 store 的持久化屏障(刷新后replayBarrier = 持久化 maxSeenSeq= 该常量)拒绝一切新围栏(order[0] <= barrier):dock 停在旧快照、旧按钮 action 仍活、控制台零日志、清 localStorage 恢复但刷新复发。修复
src/client/dom-fence.tsxanchorSeqOf:从 assistant-step key 解析<turn>:<step>,seq = turn*1000+step—— 随消息顺序严格单调,刷新后新消息的 turn 必然大于持久化屏障 → 新面板正常更新;历史重放(同 turn)依旧被屏障正确杀死。非 assistant 行 / 无锚点(Safari)行保留文档序兜底/panel本地覆盖连带修复:localBarrier同样依赖该 seq,此前 /panel 一次也会冻结后续所有面板更新——同一根因,一并解决applyPanelOperationbarrier 拒绝路径加一次性console.warn([genui] 面板操作被重放屏障拒绝(source …,order[0]=… ≤ replayBarrier … / localBarrier …),每 source 每页面会话一条);预算 overflow 后置 append 拒绝仍走既有 budget 诊断不重复告警验证
expected '面板B' to be '面板C',精确复现报告症状;同 turn 内 step 单调性;屏障拒绝告警一次/条lib/client.js已重建并提交