Skip to content

fix: discover DSH desktop and rotated sessions (MEMMY-491) - #571

Open
whqf1123 wants to merge 2 commits into
MemTensor:v1.2.1from
whqf1123:fix/memmy-491-dsh-session-discovery
Open

whqf1123 wants to merge 2 commits into
MemTensor:v1.2.1from
whqf1123:fix/memmy-491-dsh-session-discovery

Conversation

@whqf1123

@whqf1123 whqf1123 commented Sep 29, 2026 •

Copy link
Copy Markdown

问题与修复

关联云效任务:MEMMY-491「用户自定义的目录,Memmy 内置源 deepseek_harness 扫描扫不到」。

历史扫描会漏掉 DSH Desktop 目录及带时间戳的轮转备份,压缩备份也不能仅按文件末尾 .zstd 判断。修复同时覆盖桌面后端与独立 Memory 服务:

  • 默认检查 CLI 与各系统 Desktop 会话目录;显式配置 DSH_HOME 时只使用指定目录,任意自定义目录不会自动全盘搜索。
  • 扫描和解码复用当前目标分支的 AgentSourceCore,支持版本化会话及 .bak-<数字时间戳> 文件。
  • 保留公共模块最新正常会话代际选择、同代压缩文件优先以及原生对话轮次解析;历史扫描额外读取备份,插件选择当前会话时不选择备份。
  • 多根目录排序和上限统一处理,真实路径去重,保留轮转前后的消息身份和取消处理。
  • 提供 60 项专项测试及配置说明;测试样本包含当前公共解析器要求的 turn/start 和 turn/end。

当前目标:v1.2.1。已将目标提交 1aa06142 merge 到原任务分支,解决两套 DSH session-discovery/session-reader 的 4 个冲突文件。保留公司公共模块重构,未用旧解析器覆盖新实现。相对目标分支共 14 个文件,不含凭据、个人配置、数据库或安装包。

验证结果

2026-10-01,macOS arm64、Node.js 22.23.3,在冲突解决后的代码上执行:

检查 结果
npm run test:dsh-compat 60 项通过
npm run test -w @memmy/agent-source-core 61 项通过
npm run lint 通过
npm run typecheck 通过
npm run build 通过
npm run memory:test 再次完整运行 1067 项通过、1 项跳过;首次运行 1066 项通过、1 项失败、1 项跳过,自动扫描等待超时,复测未复现
npm run test -w @memmy/backend 924 项通过、2 项失败
npm run test:packaging-guards 42 项通过、2 项失败
git diff --check --cached 通过

专项新增验证公共模块最新正常会话选择与备份扫描可并存、插件不会误选备份、原生轮次完成/未完成状态仍保持,以及无头文件轮转身份稳定。

已知限制与待验收

  • 后端两项失败仍为云客户端地区断言:项目本地 .env 设置 MEMMY_APP_EDITION=intl,Vitest 配置读取该文件,而两项测试期待 cn。对应实现、测试和 Vitest 配置与目标分支一致;本次不修改用户配置或放宽断言。此前版本号断言失败在当前目标版本已不再出现。
  • 打包两项失败仍发生于日志初始化,/dev/fd/62: Operation not permitted 导致日志/版本保护测试提前退出;相关脚本和测试与目标分支一致。具体权限限制仍需在适当环境排查,不能认定打包检查通过。
  • 本轮未完成完整 npm test 全链路、Windows/Linux 实机及 macOS 安装包的安装、升级、重启验收。
  • 9 月 29 日旧修复版已在 Mac 测试程序验证新版及备份文件的两个独立虚构样本成功导入;该记录不是本轮合并后版本的 GUI 验收,本轮证据为上述自动化检查。
  • 保留目标分支的文件加载方式:压缩日志先完整解码,再逐条产出原生轮次消息。
  • 补回此前漏扫历史需执行 DSH 完整历史扫描。

请负责人审核冲突整合方式并确认剩余测试和实机验收安排。未通过或未执行的检查不视为通过;本次只更新 PR,不合并、不发布。

@syzsunshine219
syzsunshine219 changed the base branch from memmy_1031/v1.2.0 to v1.2.0 September 30, 2026 03:20
@syzsunshine219
syzsunshine219 changed the base branch from v1.2.0 to memmy_1031/v1.2.0 September 30, 2026 03:20
@syzsunshine219
syzsunshine219 changed the base branch from memmy_1031/v1.2.0 to release/v1.2.0 September 30, 2026 09:24
@syzsunshine219
syzsunshine219 marked this pull request as ready for review September 30, 2026 09:25
@syzsunshine219
syzsunshine219 changed the base branch from release/v1.2.0 to main September 30, 2026 09:35
@syzsunshine219
syzsunshine219 changed the base branch from main to v1.2.1 September 30, 2026 09:42

This branch has not been deployed

No deployments
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.

1 participant