sage-mem 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -260,7 +260,14 @@ export async function writeReport(payload) {
260
260
  // 「续写」必须标出来:否则同一轮出现好几条,读起来像模型重复劳动。
261
261
  const mark = t.continuation ? '(截断续写)' : ''
262
262
  const kind = t.tools.length ? `:调用 ${t.tools.join('、')}` : ':结束'
263
- return `- 第 ${t.step} 轮${mark}${kind}${t.text ? ` — ${t.text.slice(0, 120)}` : ''}`
263
+ // ⚠️ **先压平空白再截断**。模型这一步的文字里常带换行与 `## 标题`,直接 slice(0,120)
264
+ // 会把标题漏成真标题 —— 报告读起来像「内容重复了一遍」(2026-10-17 10:42 那次真踩到:
265
+ // 「过程」最后一条把下一节的 `## 一、必须修改的…` 顶了出来)。
266
+ const brief = String(t.text ?? '')
267
+ .replace(/\s+/g, ' ')
268
+ .trim()
269
+ .slice(0, 120)
270
+ return `- 第 ${t.step} 轮${mark}${kind}${brief ? ` — ${brief}` : ''}`
264
271
  }),
265
272
  '',
266
273
  ]
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "sage-mem",
3
3
  "description": "Cross-session memory for DeepSeek Harness — plain markdown files, no database, no worker.",
4
- "version": "1.0.1",
4
+ "version": "1.0.2",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
7
7
  "exports": {