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

推荐订阅源

月光博客
月光博客
Martin Fowler
Martin Fowler
Last Week in AI
Last Week in AI
罗磊的独立博客
阮一峰的网络日志
阮一峰的网络日志
博客园 - 【当耐特】
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 三生石上(FineUI控件)
S
SegmentFault 最新的问题
V
Visual Studio Blog
Hugging Face - Blog
Hugging Face - Blog
雷峰网
雷峰网
博客园_首页
人人都是产品经理
人人都是产品经理
量子位
美团技术团队
The Cloudflare Blog
小众软件
小众软件
WordPress大学
WordPress大学
有赞技术团队
有赞技术团队
M
MIT News - Artificial intelligence
Microsoft Security Blog
Microsoft Security Blog
D
DataBreaches.Net
博客园 - Franky

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
refactor(auto-reply): add lifecycle storage seams (#93685...
jalehman · 2026-06-19 · via Recent Commits to openclaw:main

@@ -17,6 +17,8 @@ import {

1717

loadSessionEntry,

1818

loadTranscriptEvents,

1919

patchSessionEntry,

20+

persistSessionResetLifecycle,

21+

persistSessionRolloverLifecycle,

2022

persistSessionTranscriptTurn,

2123

purgeDeletedAgentSessionEntries,

2224

publishTranscriptUpdate,

@@ -597,6 +599,118 @@ describe("session accessor file-backed seam", () => {

597599

expect(fs.readdirSync(siblingDir)).toEqual(["sibling-lifecycle.jsonl"]);

598600

});

599601602+

it("persists reset lifecycle entry changes with transcript replay and cleanup", async () => {

603+

const now = Date.now();

604+

const sessionKey = "agent:main:main";

605+

const previousTranscript = path.join(tempDir, "previous-session.jsonl");

606+

const nextTranscript = path.join(tempDir, "next-session.jsonl");

607+

const previousEntry: SessionEntry = {

608+

sessionFile: previousTranscript,

609+

sessionId: "previous-session",

610+

updatedAt: now,

611+

};

612+

const nextEntry: SessionEntry = {

613+

sessionFile: nextTranscript,

614+

sessionId: "next-session",

615+

updatedAt: now + 1,

616+

};

617+

fs.writeFileSync(

618+

previousTranscript,

619+

[

620+

JSON.stringify({ type: "session", id: "previous-session" }),

621+

JSON.stringify({

622+

id: "msg-user",

623+

message: { role: "user", content: "hello" },

624+

parentId: null,

625+

timestamp: "2026-06-16T00:00:00.000Z",

626+

type: "message",

627+

}),

628+

JSON.stringify({

629+

id: "msg-assistant",

630+

message: { role: "assistant", content: "hi" },

631+

parentId: "msg-user",

632+

timestamp: "2026-06-16T00:00:01.000Z",

633+

type: "message",

634+

}),

635+

].join("\n") + "\n",

636+

"utf-8",

637+

);

638+

await upsertSessionEntry({ sessionKey, storePath }, previousEntry);

639+640+

const result = await persistSessionResetLifecycle({

641+

agentId: "main",

642+

cleanupPreviousTranscript: true,

643+

nextEntry,

644+

nextSessionFile: nextTranscript,

645+

previousEntry,

646+

previousSessionId: previousEntry.sessionId,

647+

sessionKey,

648+

storePath,

649+

});

650+651+

expect(result.replayedMessages).toBe(2);

652+

expect(loadSessionEntry({ sessionKey, storePath })).toMatchObject(nextEntry);

653+

expect(fs.existsSync(previousTranscript)).toBe(false);

654+

expect(fs.readFileSync(nextTranscript, "utf-8")).toContain('"content":"hello"');

655+

});

656+657+

it("persists rollover entries and returns archived previous transcript info", async () => {

658+

const now = Date.now();

659+

const sessionKey = "agent:main:telegram:dm:user";

660+

const retiredKey = "agent:main:main";

661+

const previousTranscript = path.join(tempDir, "previous-rollover.jsonl");

662+

const previousEntry: SessionEntry = {

663+

sessionFile: previousTranscript,

664+

sessionId: "previous-rollover",

665+

updatedAt: now,

666+

};

667+

const nextEntry: SessionEntry = {

668+

sessionFile: path.join(tempDir, "next-rollover.jsonl"),

669+

sessionId: "next-rollover",

670+

updatedAt: now + 1,

671+

};

672+

fs.writeFileSync(previousTranscript, '{"type":"session","id":"previous-rollover"}\n', "utf-8");

673+

await upsertSessionEntry({ sessionKey, storePath }, previousEntry);

674+

await upsertSessionEntry(

675+

{ sessionKey: retiredKey, storePath },

676+

{

677+

lastChannel: "telegram",

678+

lastTo: "user",

679+

sessionId: "legacy-main",

680+

updatedAt: now,

681+

},

682+

);

683+684+

const result = await persistSessionRolloverLifecycle({

685+

activeSessionKey: sessionKey,

686+

agentId: "main",

687+

previousEntry,

688+

retiredEntry: {

689+

key: retiredKey,

690+

entry: {

691+

sessionId: "legacy-main",

692+

updatedAt: now,

693+

},

694+

},

695+

sessionEntry: nextEntry,

696+

sessionKey,

697+

storePath,

698+

});

699+700+

expect(result.sessionEntry).toMatchObject(nextEntry);

701+

expect(result.previousSessionTranscript.transcriptArchived).toBe(true);

702+

expect(result.previousSessionTranscript.sessionFile).toContain(

703+

"previous-rollover.jsonl.reset.",

704+

);

705+

expect(loadSessionEntry({ sessionKey, storePath })).toMatchObject(nextEntry);

706+

expect(loadSessionEntry({ sessionKey: retiredKey, storePath })).toEqual({

707+

sessionId: "legacy-main",

708+

updatedAt: expect.any(Number),

709+

});

710+

expect(fs.existsSync(previousTranscript)).toBe(false);

711+

expect(fs.existsSync(result.previousSessionTranscript.sessionFile ?? "")).toBe(true);

712+

});

713+600714

it("loads and appends transcript events through a session scope", async () => {

601715

const scope = {

602716

sessionFile: transcriptPath,