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

推荐订阅源

Engineering at Meta
Engineering at Meta
D
Docker
IT之家
IT之家
博客园_首页
罗磊的独立博客
V
V2EX
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
美团技术团队
Y
Y Combinator Blog
博客园 - 聂微东
量子位
阮一峰的网络日志
阮一峰的网络日志
GbyAI
GbyAI
Microsoft Security Blog
Microsoft Security Blog
博客园 - Franky
Martin Fowler
Martin Fowler
Jina AI
Jina AI
大猫的无限游戏
大猫的无限游戏
C
Check Point Blog
月光博客
月光博客
G
Google Developers Blog
B
Blog
T
The Blog of Author Tim Ferriss
爱范儿
爱范儿

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: migrate bundled transcript target lookups (#899...
jalehman · 2026-06-24 · via Recent Commits to openclaw:main

@@ -204,31 +204,18 @@ const recordInboundSession = vi.hoisted(() =>

204204

vi.fn<(params?: unknown) => Promise<void>>(async () => {}),

205205

);

206206

const configSessionsMocks = vi.hoisted(() => ({

207-

loadSessionStore: vi.fn<(storePath: string, opts?: unknown) => Record<string, unknown>>(

208-

() => ({}),

209-

),

210-

readSessionUpdatedAt: vi.fn<(params?: unknown) => number | undefined>(() => undefined),

211-

readLatestAssistantTextFromSessionTranscript: vi.fn<

212-

(sessionFile: string) => Promise<{ text: string; timestamp?: number } | undefined>

207+

getSessionEntry: vi.fn<(params?: unknown) => unknown>(() => undefined),

208+

readLatestAssistantTextByIdentity: vi.fn<

209+

(params?: unknown) => Promise<{ text: string; timestamp?: number } | undefined>

213210

>(async () => undefined),

214-

resolveAndPersistSessionFile: vi.fn<(params?: unknown) => Promise<{ sessionFile: string }>>(

215-

async () => ({ sessionFile: "/tmp/openclaw-discord-process-test-session.jsonl" }),

216-

),

217-

resolveSessionStoreEntry: vi.fn<

218-

(params: { store: Record<string, unknown>; sessionKey?: string }) => { existing?: unknown }

219-

>((params) => ({

220-

existing: params.sessionKey ? params.store[params.sessionKey] : undefined,

221-

})),

211+

readSessionUpdatedAt: vi.fn<(params?: unknown) => number | undefined>(() => undefined),

222212

resolveStorePath: vi.fn<(path?: unknown, opts?: unknown) => string>(

223213

() => "/tmp/openclaw-discord-process-test-sessions.json",

224214

),

225215

}));

226-

const loadSessionStore = configSessionsMocks.loadSessionStore;

216+

const getSessionEntry = configSessionsMocks.getSessionEntry;

217+

const readLatestAssistantTextByIdentity = configSessionsMocks.readLatestAssistantTextByIdentity;

227218

const readSessionUpdatedAt = configSessionsMocks.readSessionUpdatedAt;

228-

const readLatestAssistantTextFromSessionTranscript =

229-

configSessionsMocks.readLatestAssistantTextFromSessionTranscript;

230-

const resolveAndPersistSessionFile = configSessionsMocks.resolveAndPersistSessionFile;

231-

const resolveSessionStoreEntry = configSessionsMocks.resolveSessionStoreEntry;

232219

const resolveStorePath = configSessionsMocks.resolveStorePath;

233220

const createDiscordRestClientSpy = vi.hoisted(() =>

234221

vi.fn<

@@ -400,19 +387,17 @@ vi.mock("openclaw/plugin-sdk/conversation-runtime", () => ({

400387

}));

401388402389

vi.mock("openclaw/plugin-sdk/session-store-runtime", () => ({

403-

loadSessionStore: (storePath: string, opts?: unknown) =>

404-

configSessionsMocks.loadSessionStore(storePath, opts),

390+

getSessionEntry: (params?: unknown) => configSessionsMocks.getSessionEntry(params),

405391

readSessionUpdatedAt: (params?: unknown) => configSessionsMocks.readSessionUpdatedAt(params),

406-

readLatestAssistantTextFromSessionTranscript: (sessionFile: string) =>

407-

configSessionsMocks.readLatestAssistantTextFromSessionTranscript(sessionFile),

408-

resolveAndPersistSessionFile: (params?: unknown) =>

409-

configSessionsMocks.resolveAndPersistSessionFile(params),

410-

resolveSessionStoreEntry: (params: { store: Record<string, unknown>; sessionKey?: string }) =>

411-

configSessionsMocks.resolveSessionStoreEntry(params),

412392

resolveStorePath: (path?: unknown, opts?: unknown) =>

413393

configSessionsMocks.resolveStorePath(path, opts),

414394

}));

415395396+

vi.mock("openclaw/plugin-sdk/session-transcript-runtime", () => ({

397+

readLatestAssistantTextByIdentity: (params?: unknown) =>

398+

configSessionsMocks.readLatestAssistantTextByIdentity(params),

399+

}));

400+416401

vi.mock("../client.js", () => ({

417402

createDiscordRuntimeAccountContext: (params: { cfg: unknown; accountId: string }) => ({

418403

cfg: params.cfg,

@@ -505,24 +490,16 @@ beforeEach(() => {

505490

createDiscordDraftStream.mockClear();

506491

dispatchInboundMessage.mockClear();

507492

recordInboundSession.mockClear();

508-

loadSessionStore.mockClear();

509493

readSessionUpdatedAt.mockClear();

510-

readLatestAssistantTextFromSessionTranscript.mockClear();

511-

resolveAndPersistSessionFile.mockClear();

512-

resolveSessionStoreEntry.mockClear();

494+

getSessionEntry.mockClear();

495+

readLatestAssistantTextByIdentity.mockClear();

513496

resolveStorePath.mockClear();

514497

createDiscordRestClientSpy.mockClear();

515498

dispatchInboundMessage.mockResolvedValue(createNoQueuedDispatchResult());

516499

recordInboundSession.mockResolvedValue(undefined);

517-

loadSessionStore.mockReturnValue({});

518500

readSessionUpdatedAt.mockReturnValue(undefined);

519-

readLatestAssistantTextFromSessionTranscript.mockResolvedValue(undefined);

520-

resolveAndPersistSessionFile.mockResolvedValue({

521-

sessionFile: "/tmp/openclaw-discord-process-test-session.jsonl",

522-

});

523-

resolveSessionStoreEntry.mockImplementation((params) => ({

524-

existing: params.sessionKey ? params.store[params.sessionKey] : undefined,

525-

}));

501+

getSessionEntry.mockReturnValue(undefined);

502+

readLatestAssistantTextByIdentity.mockResolvedValue(undefined);

526503

resolveStorePath.mockReturnValue("/tmp/openclaw-discord-process-test-sessions.json");

527504

threadBindingTesting.resetThreadBindingsForTests();

528505

});

@@ -2272,10 +2249,8 @@ describe("processDiscordMessage draft streaming", () => {

22722249

(_value, index) => `continuation${index}`,

22732250

).join(" ")}`;

227422512275-

loadSessionStore.mockReturnValue({

2276-

"agent:main:discord:channel:c1": { sessionId: "session-1" },

2277-

});

2278-

readLatestAssistantTextFromSessionTranscript.mockResolvedValue({

2252+

getSessionEntry.mockReturnValue({ sessionId: "session-1" });

2253+

readLatestAssistantTextByIdentity.mockResolvedValue({

22792254

text: fullAnswer,

22802255

timestamp: Date.now() + 60_000,

22812256

});