fix: memory_recall includeFullText now returns L2 content instead of L0#334
Conversation
When an agent explicitly calls memory_recall with includeFullText: true, it signals active intent to retrieve detailed memory content. Previously this still returned r.entry.text (which stores the L0 abstract), making includeFullText a no-op. Fix: resolve full content via L2 → L1 → L0 fallback chain so agents get the complete narrative when they ask for it. Also expose fullText in sanitizeMemoryForSerialization so the details.memories payload carries L2 content for callers that inspect the structured response. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
确认了这个 bug 在 beta.10 上依然存在,tools.ts 里 includeFullText 确实还是返回 L0 的 text。fix 方向正确,保持 text 不变 + 加 fullText 字段,向后兼容。 麻烦 rebase 到最新 master,然后补一个 tool 级回归测试:验证 rendered output 和 details.memories[].fullText 都拿到的是 L2 内容。 rebase + 补测试后可以合 👍 |
Verify that passing includeFullText:true to memory_recall returns L2 content (not the L0 abstract) in both the rendered text output and details.memories[].fullText. Also asserts that details.memories[].text still carries L0 for backwards compatibility. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
已完成!rebase 到最新 master,并在 新增测试(
16 个测试全部通过,可以合了 🙏 |
|
感谢补测试和 rebase,修复方向没问题。代码层面有两个点需要调整: 1.
|
…ests Move fullText injection out of sanitizeMemoryForSerialization (shared helper used by all tools) and into the memory_recall execute handler, injected only when includeFullText=true. This keeps the opt-in contract clean and avoids L2 content bloating responses from other tools. Add two regression tests: - includeFullText=false: details.memories[].fullText is undefined - legacy memory (no smart metadata): fullText falls back to entry.text Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
两个问题都改好了: 1. 2. 补了两个测试
18 个测试全部通过 🙏 |
|
@rwmjhb 恒哥看一下这个 PR,作者已经改了两轮,我这边 review 过了觉得可以,你确认下能不能合 👀 |
Closes #333
Problem
memory_recallwithincludeFullText: truewas returning L0 (one-line abstract) instead of the full L2 content. This happened because thetextcolumn in LanceDB stores the L0 abstract, and the tool read directly from that column for bothincludeFullText: trueandfalse— making the parameter a no-op.Fix
Resolve full content through the L2 → L1 → L0 fallback chain when
includeFullText: true:Also add
fullTexttosanitizeMemoryForSerializationso thedetails.memoriesstructured payload exposes L2 content for callers that inspect the tool response directly.Why this matters
When an agent explicitly calls
memory_recall, it signals active intent to retrieve memory detail. Auto-recall (passive injection) returning L0 hints is fine — it keeps context concise. But an explicit tool call should return the full narrative, especially forcasesandpatternscategories where L2 contains actionable step-by-step content that L0 cannot capture in one line.Changes
src/tools.ts— 2 hunks, no new dependencies