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

推荐订阅源

博客园_首页
H
Help Net Security
腾讯CDC
宝玉的分享
宝玉的分享
H
Hackread – Cybersecurity News, Data Breaches, AI and More
L
LangChain Blog
爱范儿
爱范儿
T
The Blog of Author Tim Ferriss
J
Java Code Geeks
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
MyScale Blog
MyScale Blog
Engineering at Meta
Engineering at Meta
N
Netflix TechBlog - Medium
D
Docker
V
V2EX
Last Week in AI
Last Week in AI
G
Google Developers Blog
IT之家
IT之家
C
Check Point Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
人人都是产品经理
人人都是产品经理
博客园 - 叶小钗
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 聂微东

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
perf(sessions): find matching checkpoints without sorting...
ly-wang19 · 2026-06-27 · via Recent Commits to openclaw:main

@@ -1036,6 +1036,92 @@ describe("session accessor file-backed seam", () => {

10361036

});

10371037

});

103810381039+

it("branches from the newest matching compaction checkpoint without sorting all checkpoints", async () => {

1040+

const sourceSessionId = "11111111-1111-4111-8111-111111111111";

1041+

const branchSessionId = "22222222-2222-4222-8222-222222222222";

1042+

const branchPath = path.join(tempDir, "branch-newest.jsonl");

1043+

fs.writeFileSync(branchPath, `{"type":"session","id":"${branchSessionId}"}\n`, "utf8");

1044+

const oldMatchingCheckpoint = {

1045+

checkpointId: "checkpoint-1",

1046+

sessionKey: "agent:main:main",

1047+

sessionId: sourceSessionId,

1048+

createdAt: 10,

1049+

reason: "manual",

1050+

preCompaction: {

1051+

sessionId: sourceSessionId,

1052+

leafId: "old-leaf",

1053+

},

1054+

postCompaction: { sessionId: "33333333-3333-4333-8333-333333333333" },

1055+

} satisfies NonNullable<SessionEntry["compactionCheckpoints"]>[number];

1056+

const newestMatchingCheckpoint = {

1057+

...oldMatchingCheckpoint,

1058+

createdAt: 20,

1059+

preCompaction: {

1060+

sessionId: sourceSessionId,

1061+

leafId: "new-leaf",

1062+

},

1063+

postCompaction: { sessionId: "44444444-4444-4444-8444-444444444444" },

1064+

} satisfies NonNullable<SessionEntry["compactionCheckpoints"]>[number];

1065+

const newestDifferentCheckpoint = {

1066+

...oldMatchingCheckpoint,

1067+

checkpointId: "checkpoint-2",

1068+

createdAt: 30,

1069+

preCompaction: {

1070+

sessionId: sourceSessionId,

1071+

leafId: "different-leaf",

1072+

},

1073+

postCompaction: { sessionId: "55555555-5555-4555-8555-555555555555" },

1074+

} satisfies NonNullable<SessionEntry["compactionCheckpoints"]>[number];

1075+

fs.writeFileSync(

1076+

storePath,

1077+

JSON.stringify(

1078+

{

1079+

main: {

1080+

sessionId: sourceSessionId,

1081+

updatedAt: 30,

1082+

compactionCheckpoints: [

1083+

oldMatchingCheckpoint,

1084+

newestDifferentCheckpoint,

1085+

newestMatchingCheckpoint,

1086+

],

1087+

},

1088+

} satisfies Record<string, SessionEntry>,

1089+

null,

1090+

2,

1091+

),

1092+

"utf8",

1093+

);

1094+1095+

const result = await branchSessionFromCompactionCheckpoint({

1096+

storePath,

1097+

sourceKey: "agent:main:main",

1098+

sourceStoreKey: "main",

1099+

nextKey: "agent:main:branch-newest",

1100+

checkpointId: "checkpoint-1",

1101+

forkTranscriptFromCheckpoint: async (selectedCheckpoint) => {

1102+

expect(selectedCheckpoint).toEqual(newestMatchingCheckpoint);

1103+

return {

1104+

status: "created",

1105+

transcript: {

1106+

sessionFile: branchPath,

1107+

sessionId: branchSessionId,

1108+

},

1109+

};

1110+

},

1111+

buildEntry: ({ currentEntry, forkedTranscript }) => ({

1112+

...currentEntry,

1113+

sessionFile: forkedTranscript.sessionFile,

1114+

sessionId: forkedTranscript.sessionId,

1115+

}),

1116+

});

1117+1118+

expect(result).toMatchObject({

1119+

status: "created",

1120+

key: "agent:main:branch-newest",

1121+

checkpoint: newestMatchingCheckpoint,

1122+

});

1123+

});

1124+10391125

it("does not persist checkpoint restores when the transcript boundary is missing", async () => {

10401126

fs.writeFileSync(

10411127

storePath,