Repository navigation
fix(tools): memory_get 输出 schema 复用 MEMORY_ITEM_SCHEMA——scope 标注行不再被拒收 - #186
Conversation
…#184) 0.8.1 的 #171 给 toApiList 增加了 scope 来源三键的条件展开 (agent_scope_source / workspace_scope_source / scope_decided_at), 共享的 MEMORY_ITEM_SCHEMA 同步声明了它们,但 memory_get 的输出 schema 用的是一份内联副本且 additionalProperties:false——任何被标注过的行 走 memory_get 都会被宿主 in-process 校验拒收(invalid output), 且每写一条新记忆就多一条读不回的行。 - memory_get 的 memory 属性直接引用 MEMORY_ITEM_SCHEMA(与 list/search 同源),内联副本删除——键集漂移不可能再发生; - 导出 MEMORY_ITEM_SCHEMA 供回归测试断言同源; - 新增 test/tools-memory-get-schema.test.js:①生产同款校验器 (validateJsonSchemaValue)+ 带全量来源标注的行复现 #184(修前 逐字复现报错三条、修后零违规)②键集/required 防漂移断言。 Fixes #184
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthrough本次修改导出共享的 Changesmemory_get 输出 schema
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Medium Suggested reviewers: Merge Risk: ⚪ Minimal · up to The shipped memory_get schema now accepts scoped memory DTOs consistently with the shared memory schema; no actionable merge-blocking risk remains. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
根因(与 #184 的三段证据链一致)
0.8.1 的 #171 给
toApiList增加 scope 来源三键条件展开时,共享的MEMORY_ITEM_SCHEMA同步声明了它们,但memory_get的输出 schema 是一份内联副本且additionalProperties: false——被标注行携带新键即被宿主 in-process 校验拒收。修复
memory_get的memory属性直接引用MEMORY_ITEM_SCHEMA(与 list/search 同源),内联副本删除——键集漂移从此不可能发生;MEMORY_ITEM_SCHEMA供回归测试断言同源;test/tools-memory-get-schema.test.js:@deepseek-ai/dsh-tools的validateJsonSchemaValue)+ 带全量来源标注的行——修前逐字复现 [Bug] memory_get 输出 schema 漏声明 scope 来源列:命中任何被标注的行必然报 invalid output(0.8.1) #184 的报错(三条 not-a-declared-property,比报告多抓一条scope_decided_at),修后零违规;验证
Fixes #184
Summary by CodeRabbit
改进
memory_get、memory_search和memory_list返回一致的记忆项信息。测试