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

推荐订阅源

L
LINUX DO - 最新话题
A
Arctic Wolf
I
Intezer
V
Vulnerabilities – Threatpost
C
Cisco Blogs
MyScale Blog
MyScale Blog
NISL@THU
NISL@THU
Y
Y Combinator Blog
C
CERT Recently Published Vulnerability Notes
P
Privacy International News Feed
H
Hackread – Cybersecurity News, Data Breaches, AI and More
酷 壳 – CoolShell
酷 壳 – CoolShell
Recorded Future
Recorded Future
云风的 BLOG
云风的 BLOG
S
SegmentFault 最新的问题
Microsoft Security Blog
Microsoft Security Blog
L
LangChain Blog
博客园 - 聂微东
博客园 - 叶小钗
F
Fortinet All Blogs
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Recent Announcements
Recent Announcements
C
Cyber Attacks, Cyber Crime and Cyber Security
Latest news
Latest news
Simon Willison's Weblog
Simon Willison's Weblog
P
Palo Alto Networks Blog
S
Schneier on Security
C
Cybersecurity and Infrastructure Security Agency CISA
V
V2EX
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
The Hacker News
The Hacker News
博客园 - 司徒正美
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
L
LINUX DO - 热门话题
罗磊的独立博客
K
Kaspersky official blog
Last Week in AI
Last Week in AI
Know Your Adversary
Know Your Adversary
小众软件
小众软件
Stack Overflow Blog
Stack Overflow Blog
T
Threat Research - Cisco Blogs
D
DataBreaches.Net
Scott Helme
Scott Helme
P
Proofpoint News Feed
P
Privacy & Cybersecurity Law Blog
P
Proofpoint News Feed
博客园 - 三生石上(FineUI控件)
Hugging Face - Blog
Hugging Face - Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
F
Full Disclosure

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 test: trim doctor command hotspots · openclaw/openclaw@c66f16a test: isolate agent auth and spawn hotspots · openclaw/openclaw@9285935 test: stabilize MCP startup disposal race · openclaw/openclaw@dd9d2eb test: merge browser contract server suites · openclaw/openclaw@5817a76 test: narrow ollama provider discovery setup · openclaw/openclaw@a0d9598 build: declare qa-lab aimock runtime dependency · openclaw/openclaw@24431e5 test: speed up safe-bins exec harness · openclaw/openclaw@ee856ab test: preserve tool helpers in embedded runner mocks · openclaw/openclaw@acd86a0 refactor: move memory embeddings into provider plugins · openclaw/openclaw@77e6e4c test: reuse system-run temp fixtures · openclaw/openclaw@7e9ff0f test: trim hotspot wait overhead · openclaw/openclaw@12a59b0 Check: avoid duplicate boundary prep · openclaw/openclaw@baf11b8 test: reduce hotspot fixture overhead · openclaw/openclaw@3a59edd feat(ui): overhaul settings and slash command UX (#67819) thanks @Bun… · openclaw/openclaw@2cfb660 QA Matrix: exit cleanly on failure · openclaw/openclaw@42805d2 QA Matrix: isolate scenario coverage · openclaw/openclaw@7e659e1 Matrix: refresh crypto bootstrap state · openclaw/openclaw@94081d8 QA Lab: add provider registry · openclaw/openclaw@bb7e982 Matrix: add plugin changelog · openclaw/openclaw@4acab55 test: trim more hotspot overhead · openclaw/openclaw@f485311 test: trim remaining hotspot tests · openclaw/openclaw@6ba8626 test: narrow hotspot mocks · openclaw/openclaw@dbc8179 test: isolate gemini embedding request helpers · openclaw/openclaw@cd330f5 test: trim memory and mcp hotspots · openclaw/openclaw@fd48dfa test: slim provider registry mocks · openclaw/openclaw@2e08c77 test: harden Parallels update smoke · openclaw/openclaw@1a98090 feat: default Anthropic to Opus 4.7 · openclaw/openclaw@628b454 fix: harden node-host shell payload mutability checks · openclaw/openclaw@75c551e fix: land node-host approval binding for native binaries (#66731) (th… · openclaw/openclaw@29919bb CI: add daily schedule to CodeQL workflow (#67645) · openclaw/openclaw@69d25f5 fix(gateway): capture config hash after plugin auto-enable to prevent… · openclaw/openclaw@8c11210 fix: repair sanitized replay tool results before send (#67620) (thank… · openclaw/openclaw@c3c7a99 fix: restrict HTML timeout short-circuit to transient statuses · openclaw/openclaw@de129a6 fix: keep TUI watchdog bound to active run (#67401) (thanks @xantorres) · openclaw/openclaw@3525273 Gateway/skills: dedupe skills prefix-match + drop dead fallback on log · openclaw/openclaw@d7f489f Extensions/lmstudio: back off inference preload after consecutive fai… · openclaw/openclaw@b555214 TUI/streaming: add watchdog that resets the activity indicator after … · openclaw/openclaw@f44ab20 Agents/tool-loop: enable unknown-tool stream guard by default · openclaw/openclaw@36ed367 Gateway/skills: invalidate session skills snapshot on config write · openclaw/openclaw@b23d59a fix: classify HTML provider error pages correctly (#67642) (thanks @s… · openclaw/openclaw@e588e90 fix(skills): remove unused model-usage import (#67641) · openclaw/openclaw@55f05df docs(changelog): credit codex fix superseded PRs · openclaw/openclaw@e485f24 fix(openai-codex): normalize stale transport metadata in resolution a… · openclaw/openclaw@90801ba CI: pin Docker-related GitHub Actions (#67632) · openclaw/openclaw@f697b01 Android: modernize WebView and discovery API usage (#67627) · openclaw/openclaw@44a6e50 fix(deps): bump hono to 4.12.14 and @hono/node-server to 1.19.14 (GHS… · openclaw/openclaw@fbccc18 fix(deps): bump dompurify to 3.4.0 (#67614) · openclaw/openclaw@2c2dc00 CI: add explicit permissions to all workflow jobs (fixes code-scannin… · openclaw/openclaw@01b7516 fix: register bundled TTS providers and route overrides correctly (#6… · openclaw/openclaw@6ea3cdd fix: align host tilde paths with OS home (#62804) (thanks @stainlu) · openclaw/openclaw@ecfaf64 fix: flush creds queue before reconnect socket open (#67464) (thanks … · openclaw/openclaw@405c63f fix: strip standalone <function> tool call tags from visible text (#6… · openclaw/openclaw@78df859 fix(agents): preserve cli session metadata before transcript persist … · openclaw/openclaw@898fd04 docs(changelog): move cli transcript entry · openclaw/openclaw@c1817c6 fix(agents): normalize cli transcript api field · openclaw/openclaw@3a3fae0 docs(changelog): note cli transcript persistence · openclaw/openclaw@6c343f1 fix(agents): persist cli transcript turns · openclaw/openclaw@b8ef507 fix(msteams): harden security-sensitive flows (#65841) · openclaw/openclaw@c56b56e [Dashboard] Fix exec approval modal overflow for long command content… · openclaw/openclaw@053c5b0 Docs: remove QA changelog entry · openclaw/openclaw@7fd5771 QA: fix private runtime source loading (#67428) · openclaw/openclaw@d5933af docs(gateway): correct protocol.md schema path, hello-ok example, aut… · openclaw/openclaw@489404d CI: pin Node 22 runners to 22.18.0 · openclaw/openclaw@4ffa621 models.authStatus: normalize provider ids + tighten env-backed escape… · openclaw/openclaw@f2fdb9d Update CHANGELOG.md · openclaw/openclaw@7694a92 test(parallels): clean up npm update guard jobs · openclaw/openclaw@045ea7b Plugins: prefer scanDir override paths · openclaw/openclaw@b2974da fix(dreaming): default storage.mode to "separate" so phase blocks sto… · openclaw/openclaw@8c392f0 fix(memory-core): skip dreaming transcript ingestion via session stor… · openclaw/openclaw@a1b01f0 fix: dedupe replayed exec.finished node events (#67281) · openclaw/openclaw@5dcf526
improve: reduce hot-path linear scans and redundant I/O (#95697) · openclaw/openclaw@abd8a46
vincentkoc · 2026-06-23 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

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

1919

import {

2020

applyShortTermPromotions,

2121

auditShortTermPromotionArtifacts,

22+

filterLiveShortTermRecallEntries,

2223

isShortTermMemoryPath,

2324

loadShortTermPromotionDreamingStats,

2425

recordGroundedShortTermCandidates,

@@ -171,6 +172,42 @@ describe("short-term promotion", () => {

171172

});

172173

});

173174
175+

it("deduplicates source-file checks within a recall batch", async () => {

176+

await withTempWorkspace(async (workspaceDir) => {

177+

const notePath = await writeDailyMemoryNote(workspaceDir, "2026-04-03", [

178+

"Deduplicated source check note.",

179+

]);

180+

const relativePath = path.relative(workspaceDir, notePath).replaceAll("\\", "/");

181+

const entry = {

182+

key: "duplicate-source",

183+

path: relativePath,

184+

startLine: 1,

185+

endLine: 1,

186+

source: "memory" as const,

187+

snippet: "Deduplicated source check note.",

188+

recallCount: 1,

189+

dailyCount: 1,

190+

groundedCount: 0,

191+

totalScore: 0.9,

192+

maxScore: 0.9,

193+

firstRecalledAt: "2026-04-03T00:00:00.000Z",

194+

lastRecalledAt: "2026-04-03T00:00:00.000Z",

195+

queryHashes: ["query"],

196+

recallDays: ["2026-04-03"],

197+

conceptTags: [],

198+

};

199+

const statSpy = vi.spyOn(fs, "stat");

200+
201+

const live = await filterLiveShortTermRecallEntries({

202+

workspaceDir,

203+

entries: [entry, { ...entry, key: "duplicate-source-2" }],

204+

});

205+
206+

expect(live).toHaveLength(2);

207+

expect(statSpy).toHaveBeenCalledTimes(1);

208+

});

209+

});

210+
174211

it("falls back when the injected recall timestamp is outside Date range", async () => {

175212

vi.spyOn(Date, "now").mockReturnValue(Date.UTC(2026, 4, 30, 12, 0, 0));

176213

await withTempWorkspace(async (workspaceDir) => {

Original file line numberDiff line numberDiff line change

@@ -1302,39 +1302,47 @@ export async function loadShortTermPromotionDreamingStats(params: {

13021302

};

13031303

}

13041304
1305-

async function shortTermRecallSourceExists(params: {

1306-

workspaceDir: string;

1307-

entry: Pick<ShortTermRecallEntry, "path">;

1308-

}): Promise<boolean> {

1309-

const workspaceDir = params.workspaceDir.trim();

1310-

if (!workspaceDir) {

1311-

return false;

1312-

}

1313-

for (const sourcePath of resolveShortTermSourcePathCandidates(workspaceDir, params.entry.path)) {

1314-

try {

1315-

const stat = await fs.stat(sourcePath);

1316-

if (stat.isFile()) {

1317-

return true;

1318-

}

1319-

} catch (err) {

1320-

if ((err as NodeJS.ErrnoException).code === "ENOENT") {

1321-

continue;

1322-

}

1323-

throw err;

1305+

async function shortTermRecallSourceIsFile(sourcePath: string): Promise<boolean> {

1306+

try {

1307+

const stat = await fs.stat(sourcePath);

1308+

return stat.isFile();

1309+

} catch (err) {

1310+

if ((err as NodeJS.ErrnoException).code === "ENOENT") {

1311+

return false;

13241312

}

1313+

throw err;

13251314

}

1326-

return false;

13271315

}

13281316
13291317

export async function filterLiveShortTermRecallEntries(params: {

13301318

workspaceDir: string;

13311319

entries: ShortTermRecallEntry[];

13321320

}): Promise<ShortTermRecallEntry[]> {

1321+

const workspaceDir = params.workspaceDir.trim();

1322+

if (!workspaceDir) {

1323+

return [];

1324+

}

1325+

const sourceFileChecks = new Map<string, Promise<boolean>>();

1326+

const checkSourceFile = (sourcePath: string): Promise<boolean> => {

1327+

const existing = sourceFileChecks.get(sourcePath);

1328+

if (existing) {

1329+

return existing;

1330+

}

1331+

const check = shortTermRecallSourceIsFile(sourcePath);

1332+

sourceFileChecks.set(sourcePath, check);

1333+

return check;

1334+

};

13331335

const results = await Promise.all(

1334-

params.entries.map(async (entry) => ({

1335-

entry,

1336-

exists: await shortTermRecallSourceExists({ workspaceDir: params.workspaceDir, entry }),

1337-

})),

1336+

params.entries.map(async (entry) => {

1337+

let exists = false;

1338+

for (const sourcePath of resolveShortTermSourcePathCandidates(workspaceDir, entry.path)) {

1339+

if (await checkSourceFile(sourcePath)) {

1340+

exists = true;

1341+

break;

1342+

}

1343+

}

1344+

return { entry, exists };

1345+

}),

13381346

);

13391347

return results.filter((result) => result.exists).map((result) => result.entry);

13401348

}

Original file line numberDiff line numberDiff line change

@@ -107,6 +107,19 @@ describe("renderMarkdownIRChunksWithinLimit", () => {

107107

expect(chunks.map((chunk) => chunk.source.text)).toEqual(["A", "😀"]);

108108

});

109109
110+

it("keeps split order while processing the worklist as a stack", () => {

111+

const text = "abcdefghijklmnopqrstuvwx";

112+

const chunks = renderMarkdownIRChunksWithinLimit({

113+

ir: markdownToIR(text),

114+

limit: 5,

115+

renderChunk: (chunk) => chunk.text,

116+

measureRendered: (rendered) => rendered.length,

117+

});

118+
119+

expect(chunks.map((chunk) => chunk.source.text).join("")).toBe(text);

120+

expect(chunks.every((chunk) => chunk.rendered.length <= 5)).toBe(true);

121+

});

122+
110123

it("treats Infinity as no size cap and returns a single chunk", () => {

111124

const text = "one two three four five six seven eight nine ten";

112125

const ir = markdownToIR(text);

Original file line numberDiff line numberDiff line change

@@ -56,11 +56,14 @@ export function renderMarkdownIRChunksWithinLimit<TRendered>(

5656

}

5757
5858

const normalizedLimit = resolveIntegerOption(options.limit, 1, { min: 1 });

59-

const pending = chunkMarkdownIR(options.ir, normalizedLimit);

59+

// Treat the pending worklist as a stack so each dequeue/enqueue stays O(1).

60+

// The initial reverse keeps the final order stable while avoiding shift/unshift

61+

// moving every remaining chunk for long messages.

62+

const pending = chunkMarkdownIR(options.ir, normalizedLimit).toReversed();

6063

const finalized: MarkdownIR[] = [];

6164
6265

while (pending.length > 0) {

63-

const chunk = pending.shift();

66+

const chunk = pending.pop();

6467

if (!chunk) {

6568

continue;

6669

}

@@ -77,7 +80,12 @@ export function renderMarkdownIRChunksWithinLimit<TRendered>(

7780

finalized.push(chunk);

7881

continue;

7982

}

80-

pending.unshift(...split);

83+

for (let index = split.length - 1; index >= 0; index -= 1) {

84+

const next = split[index];

85+

if (next) {

86+

pending.push(next);

87+

}

88+

}

8189

}

8290
8391

return coalesceWhitespaceOnlyMarkdownIRChunks(finalized, normalizedLimit, options).map(

Original file line numberDiff line numberDiff line change

@@ -2854,6 +2854,7 @@ async function processOpenAICompletionsStream(

28542854

const toolCallBlocksByIndex = new Map<number, ToolCallBlock>();

28552855

const toolCallBlocksById = new Map<string, ToolCallBlock>();

28562856

const toolCallBlockBytes = new WeakMap<ToolCallBlock, number>();

2857+

const toolCallBlockIndices = new WeakMap<ToolCallBlock, number>();

28572858

let sawStopFinishReason = false;

28582859

const blockIndex = () => output.content.length - 1;

28592860

const measureUtf8Bytes = (text: string) => Buffer.byteLength(text, "utf8");

@@ -2986,14 +2987,15 @@ async function processOpenAICompletionsStream(

29862987

};

29872988

currentBlock = block;

29882989

output.content.push(block);

2990+

toolCallBlockIndices.set(block, output.content.length - 1);

29892991

pushStreamEvent({

29902992

type: "toolcall_start",

2991-

contentIndex: output.content.indexOf(block),

2993+

contentIndex: toolCallBlockIndices.get(block) ?? -1,

29922994

partial: output,

29932995

});

29942996

pushStreamEvent({

29952997

type: "toolcall_delta",

2996-

contentIndex: output.content.indexOf(block),

2998+

contentIndex: toolCallBlockIndices.get(block) ?? -1,

29972999

delta: toolCall.partialArgs,

29983000

partial: output,

29993001

});

@@ -3186,9 +3188,10 @@ async function processOpenAICompletionsStream(

31863188

...(initialSig ? { thoughtSignature: initialSig } : {}),

31873189

};

31883190

output.content.push(block);

3191+

toolCallBlockIndices.set(block, output.content.length - 1);

31893192

pushStreamEvent({

31903193

type: "toolcall_start",

3191-

contentIndex: output.content.indexOf(block),

3194+

contentIndex: toolCallBlockIndices.get(block) ?? -1,

31923195

partial: output,

31933196

});

31943197

}

@@ -3218,7 +3221,7 @@ async function processOpenAICompletionsStream(

32183221

block.arguments = parseStreamingJson(block.partialArgs);

32193222

pushStreamEvent({

32203223

type: "toolcall_delta",

3221-

contentIndex: output.content.indexOf(block),

3224+

contentIndex: toolCallBlockIndices.get(block) ?? -1,

32223225

delta: toolCall.function.arguments,

32233226

partial: output,

32243227

});

Original file line numberDiff line numberDiff line change

@@ -223,7 +223,7 @@ async function resolveTranscriptLeafIdFromTrailingControls(

223223

return { appendMode: "active" };

224224

}

225225
226-

async function readTranscriptLeafInfo(transcriptPath: string): Promise<TranscriptLeafInfo> {

226+

async function readTranscriptLeafInfoForward(transcriptPath: string): Promise<TranscriptLeafInfo> {

227227

let leafId: string | undefined;

228228

let hasParentLinkedEntries = false;

229229

let nonSessionEntryCount = 0;

@@ -266,6 +266,57 @@ async function readTranscriptLeafInfo(transcriptPath: string): Promise<Transcrip

266266

};

267267

}

268268
269+

async function readTranscriptLeafInfo(transcriptPath: string): Promise<TranscriptLeafInfo> {

270+

let latestEntryId: string | undefined;

271+

for await (const line of streamSessionTranscriptLinesReverse(transcriptPath)) {

272+

const lineInfo = readTranscriptLineInfo(line);

273+

if (!lineInfo.entryId) {

274+

continue;

275+

}

276+

if (lineInfo.invalidLeafControl) {

277+

break;

278+

}

279+

if (lineInfo.leafControl) {

280+

if (latestEntryId) {

281+

const valid = await validateTranscriptLeafControlReferences({

282+

transcriptPath,

283+

leafControlId: lineInfo.entryId,

284+

leafControl: lineInfo.leafControl,

285+

});

286+

if (!valid) {

287+

break;

288+

}

289+

return {

290+

leafId: latestEntryId,

291+

appendMode: lineInfo.leafControl.appendMode === "side" ? "side" : "active",

292+

hasParentLinkedEntries: true,

293+

nonSessionEntryCount: 0,

294+

};

295+

}

296+

const resolvedLeaf = await resolveTranscriptLeafIdFromTrailingControls(transcriptPath);

297+

return {

298+

...(resolvedLeaf.leafId ? { leafId: resolvedLeaf.leafId } : {}),

299+

appendMode: resolvedLeaf.appendMode,

300+

hasParentLinkedEntries: true,

301+

nonSessionEntryCount: 0,

302+

};

303+

}

304+

latestEntryId ??= lineInfo.entryId;

305+

if (lineInfo.isCanonicalEntry && lineInfo.hasParentLinkedEntry) {

306+

return {

307+

leafId: latestEntryId,

308+

appendMode: lineInfo.appendMode === "side" ? "side" : "active",

309+

hasParentLinkedEntries: true,

310+

nonSessionEntryCount: 0,

311+

};

312+

}

313+

// A latest entry without parent linkage may be a legacy linear transcript.

314+

// Fall back to the full scan only when migration detection needs it.

315+

break;

316+

}

317+

return await readTranscriptLeafInfoForward(transcriptPath);

318+

}

319+
269320

async function migrateLinearTranscriptToParentLinked(transcriptPath: string): Promise<{

270321

leafId?: string;

271322

}> {