fix(dashboard): 收敛群级 Pin 管理边界 - #1183
Open
TWT233 wants to merge 18 commits into
Open
Conversation
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
deepcoldy#852 将会话存储引擎换为 per-bot SQLite 后,daemon 侧仍保留整套 JSON 写实现(save() 整图序列化、JSON CAS、tmp+rename)。本 PR 删除这套实现,daemon 落盘改为行级 upsert。 跨进程读与离线写刻意保留 db-else-json 回落:npm 升级后 postinstall 立即替换 CLI,而持有会话行的 daemon 仍运行旧代码(自动更新默认关闭),该窗口无上界,期间对应 bot 目录不存在 .db;若跨进程读改为只认 SQLite,窗口内所有 botmux send 都将无法定位自身会话。 一并修复与加固: - 读写方式打开 SQLite 会创建空库,而导入门判据是 existsSync(db),空库会使 daemon 跳过一次性导入并丢失迁移前全部会话。读路径对不存在的库直接抛错,离线写在 open 前复检。 - 导入按文件原 key 而非行内 sessionId:两条记录可能携带同一 sessionId,INSERT OR REPLACE 会让 closed 幽灵覆盖活行,且导入只跑一次、JSON 随后冻结,不可逆。 - close / reactivate / mojo journal 改为先落盘再合并回内存,替代原先失败后逐字段手工还原。 - 删除白板时的会话解绑:原按文件名扫描 sessions*.json,deepcoldy#852 之后匹配不到文件,clearedSessions 恒为 0 而 whiteboardId 仍指向已删的板。改走 store,daemon 在线时经 IPC 带 CAS 解绑,不在时离线写;无法解绑的会话计入 unresolvedSessions 而非谎报 0;IPC 增加超时。 - 屏蔽 Node 22 加载 node:sqlite 时的 ExperimentalWarning,避免污染 CLI stderr 与全屏 TUI。 影响面:主要涉及 session-store、whiteboard-store、dashboard-ipc-server,新增 services/session-offline-write.ts;cli.ts 私有的 daemon 发现实现收敛到 utils/daemon-discovery。updateSession 等签名不变,Pty/Tmux、话题会话/群会话、adopt/restore、sandbox 开关仍走同一套 store 导出。沙盒授权维持目录级(单文件 bind 会钉死 WAL sidecar 的 inode)。 验证:tsc --noEmit 干净,bun run build 通过,门禁 CI 全绿;PR 触及的 21 个测试文件逐文件单跑共 558 条通过。对核心不变量做 10 处反变异,8 处如期变红(升级窗口回落、解绑 CAS、409 分支、unresolvedSessions 计数、durable-first 提交顺序、导入不重键、owner:false 不得 bootstrap、实验特性警告过滤);其余 2 处为 TOCTOU 竞态防护,单线程测试无法构造触发窗口,已另行验证守卫有效。bun-test 为 continue-on-error 非门禁项,其失败经本地实跑对照确认为既有 flake。 Co-authored-by: TRAE CLI <traecli@bytedance.com>
…lowups Co-authored-by: TRAE CLI <traecli@bytedance.com>
…lowups Co-authored-by: TRAE CLI <traecli@bytedance.com>
…lowups Co-authored-by: TRAE CLI <traecli@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Contributor
Author
|
补充说明:该 PR 保持 #1155 的 per-chat negative override 语义不变,只收敛合入后 review 暴露的 Dashboard correctness / safety:
|
Contributor
Author
|
本地最终验证补充(当前 HEAD 1a634c2):
GitHub build job 的失败来自 test/mojo-close-worker-journal.integration.test.ts,不在本 PR diff;同一 job 的 compile/build 步骤已通过。 |
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
…ollowups Co-authored-by: TRAE CLI <traecli@bytedance.com>
Contributor
Author
|
更新后的本地验证(当前 HEAD
本轮修复覆盖四个可复现竞态:跨 consumer 的共享缓存回退、Oncall 保存后被旧快照覆盖、已卸载弹窗继续 disband、旧操作完成误关新弹窗。测试顺序依赖也已用 shuffle 复现并修复。最终 Spec 与 Standards 复审均无 Critical / Important finding。 |
Co-authored-by: TRAE CLI <traecli@bytedance.com>
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.
背景
这是已合入 #1155 的 correctness / safety follow-up,落实合入后 review 指出的响应体积、鉴权与异步快照一致性问题。
改动
影响面
仅调整 Dashboard 群组矩阵 payload、Group Manage 客户端状态与相关测试;不改变 daemon 的 per-chat Pin 配置语义或实时卡生命周期。
验证
Follow-up to #1155.