惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
SegmentFault 最新的问题
B
Blog
P
Proofpoint News Feed
美团技术团队
The GitHub Blog
The GitHub Blog
Y
Y Combinator Blog
A
About on SuperTechFans
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Vercel News
Vercel News
有赞技术团队
有赞技术团队
小众软件
小众软件
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Google DeepMind News
Google DeepMind News
Martin Fowler
Martin Fowler
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
aimingoo的专栏
aimingoo的专栏
H
Help Net Security
罗磊的独立博客
L
LangChain Blog
GbyAI
GbyAI
腾讯CDC
T
The Blog of Author Tim Ferriss
Microsoft Security Blog
Microsoft Security Blog

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix(agents): lower session repair success logging · openc...
steipete · 2026-05-03 · via Recent Commits to openclaw:main

@@ -128,17 +128,17 @@ describe("repairSessionFileIfNeeded", () => {

128128

const original = `${JSON.stringify(header)}\n${JSON.stringify(message)}\n${JSON.stringify(poisonedAssistantEntry)}\n${JSON.stringify(followUp)}\n`;

129129

await fs.writeFile(file, original, "utf-8");

130130131-

const warn = vi.fn();

132-

const result = await repairSessionFileIfNeeded({ sessionFile: file, warn });

131+

const debug = vi.fn();

132+

const result = await repairSessionFileIfNeeded({ sessionFile: file, debug });

133133134134

expect(result.repaired).toBe(true);

135135

expect(result.droppedLines).toBe(0);

136136

expect(result.rewrittenAssistantMessages).toBe(1);

137137

expect(result.backupPath).toBeTruthy();

138-

expect(warn).toHaveBeenCalledTimes(1);

139-

const warnMessage = warn.mock.calls[0]?.[0] as string;

140-

expect(warnMessage).toContain("rewrote 1 assistant message(s)");

141-

expect(warnMessage).not.toContain("dropped");

138+

expect(debug).toHaveBeenCalledTimes(1);

139+

const debugMessage = debug.mock.calls[0]?.[0] as string;

140+

expect(debugMessage).toContain("rewrote 1 assistant message(s)");

141+

expect(debugMessage).not.toContain("dropped");

142142143143

const repaired = await fs.readFile(file, "utf-8");

144144

const repairedLines = repaired.trim().split("\n");

@@ -167,13 +167,13 @@ describe("repairSessionFileIfNeeded", () => {

167167

const original = `${JSON.stringify(header)}\n${JSON.stringify(blankUserEntry)}\n${JSON.stringify(message)}\n`;

168168

await fs.writeFile(file, original, "utf-8");

169169170-

const warn = vi.fn();

171-

const result = await repairSessionFileIfNeeded({ sessionFile: file, warn });

170+

const debug = vi.fn();

171+

const result = await repairSessionFileIfNeeded({ sessionFile: file, debug });

172172173173

expect(result.repaired).toBe(true);

174174

expect(result.rewrittenUserMessages).toBe(1);

175175

expect(result.droppedBlankUserMessages).toBe(0);

176-

expect(warn.mock.calls[0]?.[0]).toContain("rewrote 1 user message(s)");

176+

expect(debug.mock.calls[0]?.[0]).toContain("rewrote 1 user message(s)");

177177178178

const repaired = await fs.readFile(file, "utf-8");

179179

const repairedLines = repaired.trim().split("\n");

@@ -243,7 +243,7 @@ describe("repairSessionFileIfNeeded", () => {

243243

]);

244244

});

245245246-

it("reports both drops and rewrites in the warn message when both occur", async () => {

246+

it("reports both drops and rewrites in the debug message when both occur", async () => {

247247

const { file } = await createTempSessionPath();

248248

const { header } = buildSessionHeaderAndMessage();

249249

const poisonedAssistantEntry = {

@@ -264,15 +264,15 @@ describe("repairSessionFileIfNeeded", () => {

264264

const original = `${JSON.stringify(header)}\n${JSON.stringify(poisonedAssistantEntry)}\n{"type":"message"`;

265265

await fs.writeFile(file, original, "utf-8");

266266267-

const warn = vi.fn();

268-

const result = await repairSessionFileIfNeeded({ sessionFile: file, warn });

267+

const debug = vi.fn();

268+

const result = await repairSessionFileIfNeeded({ sessionFile: file, debug });

269269270270

expect(result.repaired).toBe(true);

271271

expect(result.droppedLines).toBe(1);

272272

expect(result.rewrittenAssistantMessages).toBe(1);

273-

const warnMessage = warn.mock.calls[0]?.[0] as string;

274-

expect(warnMessage).toContain("dropped 1 malformed line(s)");

275-

expect(warnMessage).toContain("rewrote 1 assistant message(s)");

273+

const debugMessage = debug.mock.calls[0]?.[0] as string;

274+

expect(debugMessage).toContain("dropped 1 malformed line(s)");

275+

expect(debugMessage).toContain("rewrote 1 assistant message(s)");

276276

});

277277278278

it("does not rewrite silent-reply turns (stopReason=stop, content=[]) on disk", async () => {

@@ -329,12 +329,12 @@ describe("repairSessionFileIfNeeded", () => {

329329

const original = `${JSON.stringify(header)}\n${JSON.stringify(message)}\n${JSON.stringify(assistantEntry)}\n`;

330330

await fs.writeFile(file, original, "utf-8");

331331332-

const warn = vi.fn();

333-

const result = await repairSessionFileIfNeeded({ sessionFile: file, warn });

332+

const debug = vi.fn();

333+

const result = await repairSessionFileIfNeeded({ sessionFile: file, debug });

334334335335

expect(result.repaired).toBe(true);

336336

expect(result.trimmedTrailingAssistantMessages).toBe(1);

337-

expect(warn.mock.calls[0]?.[0]).toContain("trimmed 1 trailing assistant message(s)");

337+

expect(debug.mock.calls[0]?.[0]).toContain("trimmed 1 trailing assistant message(s)");

338338339339

const repaired = await fs.readFile(file, "utf-8");

340340

const repairedLines = repaired.trim().split("\n");