Skip to content

fix(service): degrade readonly recall probe against mnemon CLI 0.2.6 OOM regression - #146

Closed
HHHEEEWWW wants to merge 2 commits into
omdsh-dev:mainfrom
HHHEEEWWW:fix/readonly-recall-oom-degrade
Closed

fix(service): degrade readonly recall probe against mnemon CLI 0.2.6 OOM regression#146
HHHEEEWWW wants to merge 2 commits into
omdsh-dev:mainfrom
HHHEEEWWW:fix/readonly-recall-oom-degrade

Conversation

@HHHEEEWWW

@HHHEEEWWW HHHEEEWWW commented Aug 31, 2026

Copy link
Copy Markdown

摘要 / Summary

DSH 记忆体详情页在安装 mnemon CLI v0.2.6 时显示"连接不可用"(真实关系图 / 可枚举内容面板)。根因是 v0.2.6 的 --readonly recall 在任意查询下触发 SQLite out of memory (1)(与库大小无关,Windows amd64 实测必现,上游:mnemon-dev/mnemon#123)。

本 PR 保留 --readonly 快照作为首选探测契约(不增加访问计数),仅在 CLI 报告该已知缺陷时降级重试一次(无快照);上游修复后自动恢复 readonly 路径,无需配置或版本钉死。

关联 Issue 或背景 / Related Issue or Context

  • mnemon-dev/mnemon#123--readonly recall 在任何查询/limit/库大小下失败于 SQL logic error: out of memory (1);去掉 --readonly 后同一命令立即成功。
  • 影响:dsh-mnemon 0.4.3 的只读浏览契约(allNativeInsights / nativeMetadataSample / graph 元数据)在受影响 CLI 上全部失败。

涉及区域 / Affected Areas

  • 核心服务与路由 / Core service & routing
  • 运行时记忆 / Runtime memory
  • 记忆空间 / Memory spaces
  • 项目档案 / Project documents
  • 配置与设置 / Configuration & settings
  • 本地化 / Localization
  • 其他 / Other

PR 类型 / PR Type

  • 缺陷修复 / Bug fix
  • 新功能 / Feature
  • 重构 / Refactor
  • 文档 / Documentation
  • 构建与 CI / Build & CI
  • 面向用户的功能或行为变更 / User-facing feature or behavior change

最新代码确认 / Latest Codebase Confirmation

  • 我已基于最新 main 分支开发,或在提交前已 rebase 或合并最新 main。 / I developed from the latest main, or rebased or merged the latest main before submitting.
    同步命令 / Sync command:fork 与分支均基于最新 main(v0.4.3,aa446cf)创建,无分叉;git fetch origin && git rebase origin/main 结果:Already up to date.

AI 编码披露 / AI Coding Disclosure

  • 本 PR 由 AI 辅助完成。 / This PR was completed with AI assistance.
    使用的 AI 模型 / AI model used:deepseek-v4-flash
    使用的编码 Agent 工具 / Coding Agent tool used:DeepSeek Harness(DSH)桌面 Agent

仓库规范检查 / Repository Rules

  • 未引入新的外部依赖或已处理许可事项 / No new external dependencies or licenses cleared
  • 未破坏既有测试或已补充必要测试 / Existing tests not broken and required tests added
  • 代码风格与仓库 lint 规范一致 / Code style consistent with repository lint rules
  • 未包含密钥、令牌或敏感信息 / No secrets, tokens, or sensitive data included
  • 变更范围最小化且聚焦 / Change scope is minimal and focused
  • 已复核变更对数据安全的影响 / Data-safety impact reviewed

兼容性与数据安全 / Compatibility and Data Safety

N/A —— 本次变更仅在 --readonly 探测命中已知 CLI OOM 错误特征时降级重试一次;成功路径(含 readonly 快照契约)与所有写入/数据路径完全不变,无数据安全影响。

本地验证 / Local Validation

执行的命令 / Commands run:pnpm buildpnpm vitest run tests/service.spec.ts -t readonlypnpm vitest run tests/service.spec.ts
结果摘要 / Result summary:build OK;readonly 相关 3/3 通过(含新增降级回归测试,首次调用仍带 --readonly);service 全套 39/40 —— 唯一失败为 Windows 平台 stat-mode 差异(draft 权限位 438 vs 384)的既有问题,与本次改动无关(见 PR 内说明)。

用户可见变更证据 / Local Feature Evidence

readonly-oom-evidence

Fork 分支上的图片原址:https://github.com/HHHEEEWWW/dsh-mnemon/raw/fix/readonly-recall-oom-degrade/pr-assets/readonly-oom-evidence.png

图片内容:修复前后对比 —— BEFORE(readonly 探测 OOM、面板"连接不可用")与 AFTER(降级重试返回记忆、readonly 保持首选),及本地验证摘要。

…OOM regression

--readonly recall fails on every query with SQLite 'out of memory (1)'
on mnemon CLI 0.2.6 (mnemon-dev/mnemon#123), making memory-body browse
and graph detail panels report 'connection unavailable' in DSH.

Keep the readonly snapshot as the preferred probe contract; when the CLI
reports the known failure, retry once without the snapshot so browse and
metadata probes keep working on affected CLI releases. The readonly path
is used again automatically once an upstream fix lands.

Adds a regression test asserting the first attempt still uses --readonly
and the degraded retry drops it.
@Grivn

Grivn commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

感谢提供复现和补丁。该问题已在 mnemon-dev/mnemon#125 修复,并随 v0.2.7 发布。

移除 --readonly 的重试会修改访问计数和操作日志,影响自动清理,因此保留只读路径。此 PR 由上游修复替代,现关闭。

@Grivn Grivn closed this Aug 31, 2026
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