Repository navigation
feat(tools): 工具暴露开关 disableMemorySearch/disableMemoryArchive + 检索/归档描述使用纪律 - #276
Conversation
…_search/archive 描述使用纪律 慢/轻量模型(如 glm-5.3-flash)对「何时该用工具」判断弱,而跨会话记忆 已由 inject 每轮自动注入,memory_search/memory_archive 极易被顺手乱调—— 每次工具调用都是一次串行往返,在慢模型上被放大成明显卡顿。 - config.js + settings.js(FEATURE_FLAG_BOOLEANS)新增两个布尔开关, 面板可启停=线上回滚开关;默认关=行为逐字节不变 - tools.js 注册循环按 config 隐藏对应工具:模型看不到就不会调,比在 描述里劝它少调用更可靠。注意 live patch reload 下已注册工具不被宿主 反注册,排除只对全新会话生效(已注释说明) - memory_search 基础描述补「记忆已自动注入、注入里没有才搜」纪律(与 #249 的 TOOL_GUIDE 互补:那是 opt-in,这里是零配置兜底);memory_archive 补「仅用户要求或条目确实过时才归档,别自作主张清理」 - bin/dsh-mneme-mcp.mjs TOOL_SEARCH_DESCRIPTION 同步(lockstep 测试护栏) - tests: 工具隐藏三态 + 描述纪律断言(tools.test.js)、features effective 计数 +2(api.test.js) Co-authored-by: Anans-Ivresse <[email protected]>
|
Understand this PR’s impact Explore downstream dependencies and potential security impact with Blast Radius. Warning Review limit reachedNext included review available in 16 minutes. View limit detailsLimit details: You’ve used all 2 included reviews currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Repository: slow-stack/dsh-mneme/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (9)
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: slow-stack/dsh-mneme/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (9)
Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review. 📝 WalkthroughWalkthrough本次变更新增两个记忆工具暴露开关,更新 Changes记忆工具控制
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Feature Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant FeatureFlags
participant Config
participant ToolRegistration
FeatureFlags->>Config: 设置 disableMemorySearch 或 disableMemoryArchive
Config->>ToolRegistration: 传递工具暴露配置
ToolRegistration->>ToolRegistration: 跳过对应工具并记录 info 日志
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
* chore: v0.8.6 发布准备(版本号 + 测试徽章 + CHANGELOG/路线图占位行) 请在 CHANGELOG 与两个 README 的占位行补描述后再合并。 * chore(release): v0.8.6 发布说明与路线图补齐 CHANGELOG 的 [Unreleased] 转为 v0.8.6 小节,并补上三份未登账的改动: 工具暴露开关与描述纪律(#276)、蒸馏游标持久化(#229/#274)与旧宿主降级路径 (#279)、能力说明第 5 条文案精确性(#277)、CI 与徽章口径收敛(#281/#273/#272)。 两个 README 的 v0.8.6 占位行补描述(版本历史 + 路线图),测试徽章与注释数按 badge:sync 对齐到 1275。 --------- Co-authored-by: modusensus <[email protected]>
- 版本号 0.8.6 → 0.8.5:0.8.4 之后的下一个版本,npm 与 tag 均未占用(此前 按 #276 注释里的 v0.8.6 定版,注释与 package.json 一并归位到 v0.8.5)。 - dsh-mneme/README.md「版本历史亮点」表是倒序(新在上),prep 脚本的占位行 插在了最新已发布行(v0.8.4)之后,把 v0.8.5 排到了 v0.8.4 下面;移到表首。 路线图表为正序,v0.8.5 留在末尾不变。 - src 三处注释与两处测试注释的版本标注同步;lib/ 由 npm run sync 重生成。
背景
慢/轻量模型(如 glm-5.3-flash 一类)对「何时该用工具」的判断较弱,而跨会话记忆本就由 inject 每轮自动注入系统提示词,memory_search / memory_archive 极易被顺手反复调用——每次工具调用都是一次串行往返(生成参数 → 执行 → 回填 → 再生成),在慢模型上被放大成明显卡顿。
变更
测试
Summary by CodeRabbit
新功能
改进