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

推荐订阅源

S
SegmentFault 最新的问题
J
Java Code Geeks
V
V2EX
Blog — PlanetScale
Blog — PlanetScale
博客园 - 司徒正美
Hugging Face - Blog
Hugging Face - Blog
F
Fortinet All Blogs
aimingoo的专栏
aimingoo的专栏
B
Blog
A
About on SuperTechFans
有赞技术团队
有赞技术团队
月光博客
月光博客
Microsoft Azure Blog
Microsoft Azure Blog
阮一峰的网络日志
阮一峰的网络日志
腾讯CDC
美团技术团队
大猫的无限游戏
大猫的无限游戏
爱范儿
爱范儿
N
Netflix TechBlog - Medium
C
Check Point Blog
Recent Announcements
Recent Announcements
博客园 - Franky
博客园 - 叶小钗
T
Tailwind CSS 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
chore(deadcode): remove duplicate session transcript read...
vincentkoc · 2026-06-22 · via Recent Commits to openclaw:main

@@ -15,7 +15,6 @@ import {

1515

createSessionEntryWithTranscript,

1616

listSessionEntries,

1717

loadSessionEntry,

18-

loadTranscriptEvents,

1918

patchSessionEntry,

2019

persistSessionResetLifecycle,

2120

persistSessionRolloverLifecycle,

@@ -709,7 +708,7 @@ describe("session accessor file-backed seam", () => {

709708

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

710709

});

711710712-

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

711+

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

713712

const scope = {

714713

sessionFile: transcriptPath,

715714

sessionId: "session-1",

@@ -724,10 +723,6 @@ describe("session accessor file-backed seam", () => {

724723

await appendTranscriptEvent(scope, { type: "session", sessionId: "session-1" });

725724

await appendTranscriptEvent(scope, event);

726725727-

await expect(loadTranscriptEvents(scope)).resolves.toEqual([

728-

{ type: "session", sessionId: "session-1" },

729-

event,

730-

]);

731726

expect(fs.statSync(transcriptPath).mode & 0o777).toBe(0o600);

732727

});

733728

@@ -890,7 +885,6 @@ describe("session accessor file-backed seam", () => {

890885891886

await appendTranscriptEvent(scope, event);

892887893-

await expect(loadTranscriptEvents(scope)).resolves.toEqual([event]);

894888

// Explicit-artifact writes never touch entry metadata: no entry appears.

895889

expect(listSessionEntries({ storePath })).toEqual([]);

896890

});

@@ -1353,44 +1347,6 @@ describe("session accessor file-backed seam", () => {

13531347

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

13541348

});

135513491356-

it("loads transcript events without a session key when the read target is explicit", async () => {

1357-

const scope = {

1358-

sessionFile: transcriptPath,

1359-

sessionId: "session-1",

1360-

};

1361-

const event = {

1362-

payload: { value: "hello" },

1363-

type: "metadata",

1364-

};

1365-1366-

await appendTranscriptEvent(

1367-

{

1368-

...scope,

1369-

sessionKey: "agent:main:main",

1370-

storePath,

1371-

},

1372-

event,

1373-

);

1374-1375-

await expect(loadTranscriptEvents(scope)).resolves.toEqual([event]);

1376-

});

1377-1378-

it("loads transcript events from a generated read target without a session key", async () => {

1379-

const event = {

1380-

payload: { value: "hello" },

1381-

type: "metadata",

1382-

};

1383-1384-

fs.writeFileSync(path.join(tempDir, "session-1.jsonl"), `${JSON.stringify(event)}\n`, "utf-8");

1385-1386-

await expect(

1387-

loadTranscriptEvents({

1388-

sessionId: "session-1",

1389-

storePath,

1390-

}),

1391-

).resolves.toEqual([event]);

1392-

});

1393-13941350

it("appends messages and publishes updates through a session scope", async () => {

13951351

const scope = {

13961352

agentId: "main",

@@ -1438,17 +1394,6 @@ describe("session accessor file-backed seam", () => {

14381394

idempotencyKey: "assistant-once",

14391395

}),

14401396

});

1441-

await expect(loadTranscriptEvents(scope)).resolves.toEqual([

1442-

expect.objectContaining({ type: "session" }),

1443-

expect.objectContaining({

1444-

id: appended.messageId,

1445-

message: expect.objectContaining({

1446-

content: "hello",

1447-

idempotencyKey: "assistant-once",

1448-

}),

1449-

type: "message",

1450-

}),

1451-

]);

14521397

expect(updates).toEqual([

14531398

{

14541399

agentId: "main",

@@ -1516,22 +1461,6 @@ describe("session accessor file-backed seam", () => {

15161461

updatedAt: expect.any(Number),

15171462

});

15181463

expect(loadSessionEntry(scope)?.updatedAt).toBeGreaterThanOrEqual(10);

1519-

const events = await loadTranscriptEvents({ ...scope, sessionFile: result.sessionFile });

1520-

expect(events).toEqual([

1521-

expect.objectContaining({ type: "session" }),

1522-

expect.objectContaining({

1523-

id: result.messages[0]?.messageId,

1524-

message: expect.objectContaining({ role: "user", content: "hello" }),

1525-

parentId: null,

1526-

type: "message",

1527-

}),

1528-

expect.objectContaining({

1529-

id: result.messages[1]?.messageId,

1530-

message: expect.objectContaining({ role: "assistant", content: "hi there" }),

1531-

parentId: result.messages[0]?.messageId,

1532-

type: "message",

1533-

}),

1534-

]);

15351464

expect(updates).toEqual([

15361465

{

15371466

lineCount: 3,

@@ -1600,19 +1529,7 @@ describe("session accessor file-backed seam", () => {

16001529

}),

16011530

]);

16021531

expect(completed).toBe(true);

1603-

const [turnResult] = await results;

1604-1605-

const events = await loadTranscriptEvents({ ...scope, sessionFile: turnResult.sessionFile });

1606-

expect(

1607-

events

1608-

.filter(

1609-

(event): event is { message?: { content?: unknown }; type?: unknown } =>

1610-

typeof event === "object" &&

1611-

event !== null &&

1612-

(event as { type?: unknown }).type === "message",

1613-

)

1614-

.map((event) => event.message?.content),

1615-

).toEqual(["batch reply", "queued prompt"]);

1532+

await results;

16161533

});

1617153416181535

it("rejects expected-session transcript turns after a queued session rebind", async () => {

@@ -1726,13 +1643,6 @@ describe("session accessor file-backed seam", () => {

17261643

expect.objectContaining({ kind: "header" }),

17271644

expect.objectContaining({ kind: "id" }),

17281645

]);

1729-

await expect(loadTranscriptEvents(scope)).resolves.toEqual([

1730-

expect.objectContaining({ type: "session" }),

1731-

expect.objectContaining({

1732-

message: expect.objectContaining({ content: "owned batch" }),

1733-

type: "message",

1734-

}),

1735-

]);

17361646

});

1737164717381648

it("honors thread fallback paths when resolving transcript scope from the store", async () => {

@@ -1759,7 +1669,6 @@ describe("session accessor file-backed seam", () => {

17591669

expect(fs.realpathSync(loadSessionEntry(scope)?.sessionFile ?? "")).toBe(

17601670

fs.realpathSync(expectedTranscriptPath),

17611671

);

1762-

await expect(loadTranscriptEvents(scope)).resolves.toEqual([event]);

17631672

});

1764167317651674

it("resolves runtime transcript targets from scope without caller-owned paths", async () => {