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

推荐订阅源

Google DeepMind News
Google DeepMind News
WordPress大学
WordPress大学
S
SegmentFault 最新的问题
小众软件
小众软件
爱范儿
爱范儿
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
量子位
博客园_首页
T
Tailwind CSS Blog
The Cloudflare Blog
J
Java Code Geeks
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
U
Unit 42
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
人人都是产品经理
人人都是产品经理
N
Netflix TechBlog - Medium
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
腾讯CDC
P
Proofpoint News Feed
aimingoo的专栏
aimingoo的专栏
Recent Announcements
Recent Announcements
T
The Blog of Author Tim Ferriss
D
Docker
Microsoft Azure Blog
Microsoft Azure 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(sessions): prune malformed missing transcript rows (#...
IWhatsskill · 2026-05-17 · via Recent Commits to openclaw:main

@@ -315,6 +315,88 @@ describe("Integration: saveSessionStore with pruning", () => {

315315

await expectPathExists(freshOrphanTranscript);

316316

});

317317318+

it("sessions cleanup fix-missing prunes malformed stored session rows", async () => {

319+

applyEnforcedMaintenanceConfig(mockLoadConfig);

320+321+

const now = Date.now();

322+

const validTranscript = path.join(testDir, "valid-present.jsonl");

323+

const legacyPresentTranscript = path.join(testDir, "legacy-present.jsonl");

324+

await fs.writeFile(

325+

storePath,

326+

JSON.stringify(

327+

{

328+

"invalid-no-file": { sessionId: "agent:main:main", updatedAt: now },

329+

"invalid-bad-file": {

330+

sessionId: "agent:main:main",

331+

sessionFile: "../outside.jsonl",

332+

updatedAt: now,

333+

},

334+

"invalid-missing-relative-file": {

335+

sessionId: "agent:main:main",

336+

sessionFile: "missing.jsonl",

337+

updatedAt: now,

338+

},

339+

"agent:main:metadata": {

340+

sessionId: "agent:main:metadata",

341+

updatedAt: now,

342+

groupActivation: "always",

343+

},

344+

"legacy-present-invalid-id": {

345+

sessionId: "agent:main:main",

346+

sessionFile: "legacy-present.jsonl",

347+

updatedAt: now,

348+

},

349+

"valid-present": { sessionId: "valid-present", updatedAt: now },

350+

} satisfies Record<string, SessionEntry>,

351+

null,

352+

2,

353+

),

354+

"utf-8",

355+

);

356+

await fs.writeFile(validTranscript, "valid", "utf-8");

357+

await fs.writeFile(legacyPresentTranscript, "legacy", "utf-8");

358+359+

const dryRun = await runSessionsCleanup({

360+

cfg: {},

361+

opts: { store: storePath, dryRun: true, enforce: true, fixMissing: true },

362+

targets: [{ agentId: "main", storePath }],

363+

});

364+

const preview = dryRun.previewResults[0];

365+

expect(preview?.summary.missing).toBe(3);

366+

expect(preview?.summary.beforeCount).toBe(6);

367+

expect(preview?.summary.afterCount).toBe(3);

368+

expect(preview?.missingKeys.has("invalid-no-file")).toBe(true);

369+

expect(preview?.missingKeys.has("invalid-bad-file")).toBe(true);

370+

expect(preview?.missingKeys.has("invalid-missing-relative-file")).toBe(true);

371+

expect(preview?.missingKeys.has("agent:main:metadata")).toBe(false);

372+

expect(preview?.missingKeys.has("legacy-present-invalid-id")).toBe(false);

373+

const rawAfterDryRun = JSON.parse(await fs.readFile(storePath, "utf-8")) as Record<

374+

string,

375+

unknown

376+

>;

377+

expect(rawAfterDryRun).toHaveProperty("invalid-no-file");

378+379+

const applied = await runSessionsCleanup({

380+

cfg: {},

381+

opts: { store: storePath, enforce: true, fixMissing: true },

382+

targets: [{ agentId: "main", storePath }],

383+

});

384+385+

expect(applied.appliedSummaries[0]?.missing).toBe(3);

386+

expect(applied.appliedSummaries[0]?.afterCount).toBe(3);

387+

const persisted = loadSessionStore(storePath, { skipCache: true });

388+

expect(Object.keys(persisted)).toEqual([

389+

"agent:main:metadata",

390+

"legacy-present-invalid-id",

391+

"valid-present",

392+

]);

393+

expect(persisted["agent:main:metadata"]).toMatchObject({ groupActivation: "always" });

394+

expect(persisted["agent:main:metadata"]?.sessionId).toBeUndefined();

395+

expect(persisted["legacy-present-invalid-id"]?.sessionId).toBe("agent:main:main");

396+

await expectPathExists(validTranscript);

397+

await expectPathExists(legacyPresentTranscript);

398+

});

399+318400

it("sessions cleanup previews stale direct DM rows after dmScope returns to main", async () => {

319401

applyEnforcedMaintenanceConfig(mockLoadConfig);

320402