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

推荐订阅源

博客园 - 聂微东
GbyAI
GbyAI
S
SegmentFault 最新的问题
H
Hackread – Cybersecurity News, Data Breaches, AI and More
V
Visual Studio Blog
WordPress大学
WordPress大学
Hugging Face - Blog
Hugging Face - Blog
B
Blog
宝玉的分享
宝玉的分享
Last Week in AI
Last Week in AI
雷峰网
雷峰网
爱范儿
爱范儿
Vercel News
Vercel News
人人都是产品经理
人人都是产品经理
U
Unit 42
Microsoft Azure Blog
Microsoft Azure Blog
Microsoft Security Blog
Microsoft Security Blog
Jina AI
Jina AI
P
Proofpoint News Feed
A
About on SuperTechFans
I
InfoQ
F
Fortinet All Blogs
L
LangChain Blog
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
refactor: route transcript writers through session seam (...
jalehman · 2026-06-17 · via Recent Commits to openclaw:main

@@ -29,6 +29,11 @@ const legacyWriterNames = new Set([

2929

"updateSessionStore",

3030

"updateSessionStoreEntry",

3131

]);

32+

const legacyTranscriptWriterNames = new Set([

33+

"appendSessionTranscriptMessage",

34+

"emitSessionTranscriptUpdate",

35+

"rewriteTranscriptEntriesInSessionFile",

36+

]);

32373338

export const migratedSessionAccessorFiles = new Set([

3439

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

@@ -88,6 +93,15 @@ export const migratedSessionAccessorWriteFiles = new Set([

8893

"src/auto-reply/reply/session-usage.ts",

8994

]);

909596+

export const migratedTranscriptWriterFiles = new Set([

97+

"src/agents/command/attempt-execution.ts",

98+

"src/agents/embedded-agent-runner/context-engine-maintenance.ts",

99+

"src/config/sessions/transcript.ts",

100+

"src/gateway/server-methods/chat.ts",

101+

"src/gateway/server-methods/chat-transcript-inject.ts",

102+

"src/sessions/user-turn-transcript.ts",

103+

]);

104+91105

function normalizeRelativePath(filePath) {

92106

return filePath.replaceAll(path.sep, "/");

93107

}

@@ -127,7 +141,7 @@ function bindingName(node) {

127141

return null;

128142

}

129143130-

function findNamedSessionStoreViolations(content, fileName, legacyNames, legacyKind) {

144+

function findNamedBoundaryViolations(content, fileName, legacyNames, subject) {

131145

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

132146

const violations = [];

133147

@@ -140,7 +154,7 @@ function findNamedSessionStoreViolations(content, fileName, legacyNames, legacyK

140154

if (legacyNames.has(importedName)) {

141155

violations.push({

142156

line: toLine(sourceFile, specifier),

143-

reason: `imports legacy session store ${legacyKind} "${importedName}"`,

157+

reason: `imports ${subject} "${importedName}"`,

144158

});

145159

}

146160

}

@@ -152,15 +166,15 @@ function findNamedSessionStoreViolations(content, fileName, legacyNames, legacyK

152166

if (name && legacyNames.has(name)) {

153167

violations.push({

154168

line: toLine(sourceFile, node),

155-

reason: `aliases legacy session store ${legacyKind} "${name}"`,

169+

reason: `aliases ${subject} "${name}"`,

156170

});

157171

}

158172

}

159173160174

if (ts.isPropertyAccessExpression(node) && legacyNames.has(node.name.text)) {

161175

violations.push({

162176

line: toLine(sourceFile, node.name),

163-

reason: `references legacy session store ${legacyKind} "${node.name.text}"`,

177+

reason: `references ${subject} "${node.name.text}"`,

164178

});

165179

}

166180

@@ -171,7 +185,7 @@ function findNamedSessionStoreViolations(content, fileName, legacyNames, legacyK

171185

) {

172186

violations.push({

173187

line: toLine(sourceFile, node.argumentExpression),

174-

reason: `references legacy session store ${legacyKind} "${node.argumentExpression.text}"`,

188+

reason: `references ${subject} "${node.argumentExpression.text}"`,

175189

});

176190

}

177191

@@ -184,7 +198,7 @@ function findNamedSessionStoreViolations(content, fileName, legacyNames, legacyK

184198

) {

185199

violations.push({

186200

line: toLine(sourceFile, node.expression),

187-

reason: `calls legacy session store ${legacyKind} "${calleeName}"`,

201+

reason: `calls ${subject} "${calleeName}"`,

188202

});

189203

}

190204

}

@@ -196,6 +210,15 @@ function findNamedSessionStoreViolations(content, fileName, legacyNames, legacyK

196210

return violations;

197211

}

198212213+

function findNamedSessionStoreViolations(content, fileName, legacyNames, legacyKind) {

214+

return findNamedBoundaryViolations(

215+

content,

216+

fileName,

217+

legacyNames,

218+

`legacy session store ${legacyKind}`,

219+

);

220+

}

221+199222

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

200223

const legacyNames = legacyNamesForFile(fileName);

201224

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

@@ -206,6 +229,15 @@ export function findSessionAccessorWriteBoundaryViolations(content, fileName = "

206229

return findNamedSessionStoreViolations(content, fileName, legacyWriterNames, "writer");

207230

}

208231232+

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

233+

return findNamedBoundaryViolations(

234+

content,

235+

fileName,

236+

legacyTranscriptWriterNames,

237+

"legacy transcript writer",

238+

);

239+

}

240+209241

export async function main() {

210242

const repoRoot = resolveRepoRoot(import.meta.url);

211243

const readSourceRoots = resolveSourceRoots(repoRoot, [

@@ -220,6 +252,13 @@ export async function main() {

220252

"src/infra",

221253

]);

222254

const writeSourceRoots = resolveSourceRoots(repoRoot, ["src/agents", "src/auto-reply"]);

255+

const transcriptWriterSourceRoots = resolveSourceRoots(repoRoot, [

256+

"src/agents/command",

257+

"src/agents/embedded-agent-runner",

258+

"src/config/sessions",

259+

"src/gateway/server-methods",

260+

"src/sessions",

261+

]);

223262

const readViolations = await collectFileViolations({

224263

repoRoot,

225264

sourceRoots: readSourceRoots,

@@ -241,7 +280,14 @@ export async function main() {

241280

),

242281

findViolations: findSessionAccessorWriteBoundaryViolations,

243282

});

244-

const violations = [...readViolations, ...writeViolations];

283+

const transcriptWriterViolations = await collectFileViolations({

284+

repoRoot,

285+

sourceRoots: transcriptWriterSourceRoots,

286+

skipFile: (filePath) =>

287+

!migratedTranscriptWriterFiles.has(normalizeRelativePath(path.relative(repoRoot, filePath))),

288+

findViolations: findTranscriptWriterBoundaryViolations,

289+

});

290+

const violations = [...readViolations, ...writeViolations, ...transcriptWriterViolations];

245291246292

if (violations.length === 0) {

247293

console.log("session accessor boundary guard passed.");

@@ -253,7 +299,7 @@ export async function main() {

253299

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

254300

}

255301

console.error(

256-

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

302+

"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.",

257303

);

258304

process.exit(1);

259305

}