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

推荐订阅源

大猫的无限游戏
大猫的无限游戏
云风的 BLOG
云风的 BLOG
小众软件
小众软件
V
V2EX
博客园 - Franky
博客园 - 司徒正美
Apple Machine Learning Research
Apple Machine Learning Research
量子位
博客园 - 【当耐特】
雷峰网
雷峰网
WordPress大学
WordPress大学
Jina AI
Jina AI
Google DeepMind News
Google DeepMind News
N
Netflix TechBlog - Medium
爱范儿
爱范儿
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
阮一峰的网络日志
阮一峰的网络日志
IT之家
IT之家
Blog — PlanetScale
Blog — PlanetScale
Hugging Face - Blog
Hugging Face - Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
V
Visual Studio Blog
Microsoft Security Blog
Microsoft Security 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
refactor: route sdk session compatibility through accesso...
jalehman · 2026-06-19 · via Recent Commits to openclaw:main
11

#!/usr/bin/env node

223+

import fs from "node:fs/promises";

34

import path from "node:path";

45

import ts from "typescript";

56

import {

@@ -48,6 +49,28 @@ const legacyLifecycleCleanupNames = new Set([

4849

"archiveRemovedSessionTranscripts",

4950

"cleanupArchivedSessionTranscripts",

5051

]);

52+

const sessionStoreRuntimeFileBackedCompatNames = new Set([

53+

"loadSessionStore",

54+

"readSessionEntries",

55+

"readSessionEntry",

56+

"readLatestAssistantTextFromSessionTranscript",

57+

"readSessionStoreReadOnly",

58+

"resolveAndPersistSessionFile",

59+

"resolveSessionFilePath",

60+

"resolveSessionStoreEntry",

61+

"saveSessionStore",

62+

"updateSessionStore",

63+

]);

64+65+

export const allowedSessionStoreRuntimeFileBackedCompatExports = new Set([

66+

"loadSessionStore",

67+

"readLatestAssistantTextFromSessionTranscript",

68+

"resolveAndPersistSessionFile",

69+

"resolveSessionFilePath",

70+

"resolveSessionStoreEntry",

71+

"saveSessionStore",

72+

"updateSessionStore",

73+

]);

51745275

export const migratedSessionAccessorFiles = new Set([

5376

"src/agents/embedded-agent-runner/compaction-successor-transcript.ts",

@@ -252,6 +275,74 @@ function findNamedSessionStoreViolations(content, fileName, legacyNames, legacyK

252275

);

253276

}

254277278+

export function collectSessionStoreRuntimeFileBackedCompatExports(content, fileName = "source.ts") {

279+

const sourceFile = ts.createSourceFile(fileName, content, ts.ScriptTarget.Latest, true);

280+

const exports = new Map();

281+282+

const rememberExport = (node, exportedName, sourceName = exportedName) => {

283+

if (!sessionStoreRuntimeFileBackedCompatNames.has(sourceName)) {

284+

return;

285+

}

286+

exports.set(exportedName, {

287+

line: toLine(sourceFile, node),

288+

sourceName,

289+

});

290+

};

291+292+

for (const statement of sourceFile.statements) {

293+

const isExported = statement.modifiers?.some(

294+

(modifier) => modifier.kind === ts.SyntaxKind.ExportKeyword,

295+

);

296+

if (isExported && ts.isVariableStatement(statement)) {

297+

for (const declaration of statement.declarationList.declarations) {

298+

if (ts.isIdentifier(declaration.name)) {

299+

rememberExport(declaration.name, declaration.name.text);

300+

}

301+

}

302+

continue;

303+

}

304+

if (isExported && ts.isFunctionDeclaration(statement) && statement.name) {

305+

rememberExport(statement.name, statement.name.text);

306+

continue;

307+

}

308+

if (

309+

ts.isExportDeclaration(statement) &&

310+

statement.exportClause &&

311+

ts.isNamedExports(statement.exportClause)

312+

) {

313+

for (const specifier of statement.exportClause.elements) {

314+

rememberExport(

315+

specifier,

316+

specifier.name.text,

317+

specifier.propertyName?.text ?? specifier.name.text,

318+

);

319+

}

320+

}

321+

}

322+323+

return exports;

324+

}

325+326+

export function findSessionStoreRuntimeFileBackedCompatExportViolations(

327+

content,

328+

fileName = "source.ts",

329+

) {

330+

const exports = collectSessionStoreRuntimeFileBackedCompatExports(content, fileName);

331+

const violations = [];

332+

for (const [exportedName, exported] of exports) {

333+

if (

334+

exportedName !== exported.sourceName ||

335+

!allowedSessionStoreRuntimeFileBackedCompatExports.has(exportedName)

336+

) {

337+

violations.push({

338+

line: exported.line,

339+

reason: `exports unratcheted file-backed SDK session helper "${exported.sourceName}"`,

340+

});

341+

}

342+

}

343+

return violations;

344+

}

345+255346

export function findSessionAccessorBoundaryViolations(content, fileName = "source.ts") {

256347

const legacyNames = legacyNamesForFile(fileName);

257348

const legacyKind = legacyNames === legacyWholeStoreAccessNames ? "access" : "reader";

@@ -405,13 +496,22 @@ export async function main() {

405496

),

406497

findViolations: findSessionLifecycleCleanupBoundaryViolations,

407498

});

499+

const sessionStoreRuntimePath = path.join(repoRoot, "src/plugin-sdk/session-store-runtime.ts");

500+

const sessionStoreRuntimeCompatViolations =

501+

findSessionStoreRuntimeFileBackedCompatExportViolations(

502+

await fs.readFile(sessionStoreRuntimePath, "utf8"),

503+

sessionStoreRuntimePath,

504+

).map((violation) =>

505+

Object.assign({ path: "src/plugin-sdk/session-store-runtime.ts" }, violation),

506+

);

408507

const violations = [

409508

...readViolations,

410509

...writeViolations,

411510

...transcriptWriterViolations,

412511

...sessionCreateLifecycleViolations,

413512

...manualCompactTrimViolations,

414513

...lifecycleCleanupViolations,

514+

...sessionStoreRuntimeCompatViolations,

415515

];

416516417517

if (violations.length === 0) {

@@ -424,7 +524,7 @@ export async function main() {

424524

console.error(`- ${violation.path}:${violation.line}: ${violation.reason}`);

425525

}

426526

console.error(

427-

"Use src/config/sessions/session-accessor.ts helpers for migrated read/write and transcript-writer paths. Expand this ratchet only after a slice migrates more files.",

527+

"Use src/config/sessions/session-accessor.ts helpers for migrated read/write and transcript-writer paths. Expand file-backed SDK compatibility only as an explicit pre-SQLite migration decision.",

428528

);

429529

process.exit(1);

430530

}