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

推荐订阅源

Y
Y Combinator Blog
腾讯CDC
Recent Announcements
Recent Announcements
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Hugging Face - Blog
Hugging Face - Blog
H
Help Net Security
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Last Week in AI
Last Week in AI
博客园_首页
D
DataBreaches.Net
P
Proofpoint News Feed
云风的 BLOG
云风的 BLOG
V
Visual Studio Blog
月光博客
月光博客
Jina AI
Jina AI
Stack Overflow Blog
Stack Overflow Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 【当耐特】
Vercel News
Vercel News
WordPress大学
WordPress大学
J
Java Code Geeks
博客园 - 聂微东
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
U
Unit 42

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
fix(memory): compact short-term promotion entries · openc...
a-m-a-r-a · 2026-05-29 · via Recent Commits to openclaw:main

@@ -1126,6 +1126,79 @@ describe("short-term promotion", () => {

11261126

});

11271127

});

112811281129+

it("does not re-append promoted candidates whose marker key path contains spaces", async () => {

1130+

await withTempWorkspace(async (workspaceDir) => {

1131+

await writeDailyMemoryNoteInSubdir(workspaceDir, "project alpha", "2026-04-01", [

1132+

"alpha",

1133+

"The project alpha gateway should stay loopback-only on port 18789.",

1134+

]);

1135+

await recordShortTermRecalls({

1136+

workspaceDir,

1137+

query: "project alpha gateway",

1138+

results: [

1139+

{

1140+

path: "memory/project alpha/2026-04-01.md",

1141+

startLine: 2,

1142+

endLine: 2,

1143+

score: 0.95,

1144+

snippet: "The project alpha gateway should stay loopback-only on port 18789.",

1145+

source: "memory",

1146+

},

1147+

],

1148+

});

1149+1150+

const ranked = await rankShortTermPromotionCandidates({

1151+

workspaceDir,

1152+

minScore: 0,

1153+

minRecallCount: 0,

1154+

minUniqueQueries: 0,

1155+

});

1156+

expect(ranked.map((candidate) => candidate.key)).toContain(

1157+

"memory:memory/project alpha/2026-04-01.md:2:2",

1158+

);

1159+1160+

const firstApply = await applyShortTermPromotions({

1161+

workspaceDir,

1162+

candidates: ranked,

1163+

minScore: 0,

1164+

minRecallCount: 0,

1165+

minUniqueQueries: 0,

1166+

});

1167+

expect(firstApply.applied).toBe(1);

1168+

expect(firstApply.appended).toBe(1);

1169+1170+

const storePath = resolveShortTermRecallStorePath(workspaceDir);

1171+

const rawStore = JSON.parse(await fs.readFile(storePath, "utf-8")) as {

1172+

entries: Record<string, { promotedAt?: string }>;

1173+

};

1174+

for (const entry of Object.values(rawStore.entries)) {

1175+

delete entry.promotedAt;

1176+

}

1177+

await fs.writeFile(storePath, `${JSON.stringify(rawStore, null, 2)}\n`, "utf-8");

1178+1179+

const secondApply = await applyShortTermPromotions({

1180+

workspaceDir,

1181+

candidates: ranked,

1182+

minScore: 0,

1183+

minRecallCount: 0,

1184+

minUniqueQueries: 0,

1185+

});

1186+

expect(secondApply.applied).toBe(1);

1187+

expect(secondApply.appended).toBe(0);

1188+

expect(secondApply.reconciledExisting).toBe(1);

1189+1190+

const memoryText = await fs.readFile(path.join(workspaceDir, "MEMORY.md"), "utf-8");

1191+

expect(memoryText).toContain(

1192+

"<!-- openclaw-memory-promotion:memory:memory/project alpha/2026-04-01.md:2:2 -->",

1193+

);

1194+

expect(memoryText.match(/openclaw-memory-promotion:/g)?.length).toBe(1);

1195+

expect(

1196+

memoryText.match(/The project alpha gateway should stay loopback-only on port 18789\./g)

1197+

?.length,

1198+

).toBe(1);

1199+

});

1200+

});

1201+11291202

it("filters out candidates older than maxAgeDays during ranking", async () => {

11301203

await withTempWorkspace(async (workspaceDir) => {

11311204

await recordShortTermRecalls({

@@ -1643,6 +1716,60 @@ describe("short-term promotion", () => {

16431716

});

16441717

});

164517181719+

it("keeps promoted MEMORY.md entries compact while preserving provenance", async () => {

1720+

await withTempWorkspace(async (workspaceDir) => {

1721+

const longDailyEntry = [

1722+

"HanJammer reviewed the dashboard state and asked for durable memory hygiene.",

1723+

"The raw daily note also included implementation chatter, transient timings, repeated troubleshooting detail, and operational narration that should not be copied wholesale into MEMORY.md.",

1724+

"A curated long-term memory entry should preserve the stable conclusion without hauling the whole daily journal line into bootstrap context.",

1725+

"Extra filler keeps this source entry long enough to prove promotion output is bounded before it reaches the root memory file.",

1726+

].join(" ");

1727+

await writeDailyMemoryNote(workspaceDir, "2026-04-01", [longDailyEntry]);

1728+

await recordShortTermRecalls({

1729+

workspaceDir,

1730+

query: "memory hygiene",

1731+

results: [

1732+

{

1733+

path: "memory/2026-04-01.md",

1734+

startLine: 1,

1735+

endLine: 1,

1736+

score: 0.92,

1737+

snippet: longDailyEntry,

1738+

source: "memory",

1739+

},

1740+

],

1741+

});

1742+1743+

const ranked = await rankShortTermPromotionCandidates({

1744+

workspaceDir,

1745+

minScore: 0,

1746+

minRecallCount: 0,

1747+

minUniqueQueries: 0,

1748+

});

1749+

const applied = await applyShortTermPromotions({

1750+

workspaceDir,

1751+

candidates: ranked,

1752+

minScore: 0,

1753+

minRecallCount: 0,

1754+

minUniqueQueries: 0,

1755+

maxPromotedSnippetTokens: 55,

1756+

});

1757+1758+

expect(applied.applied).toBe(1);

1759+

const memoryText = await fs.readFile(path.join(workspaceDir, "MEMORY.md"), "utf-8");

1760+

const promotedLine = memoryText

1761+

.split("\n")

1762+

.find((line) => line.startsWith("- HanJammer reviewed the dashboard state"));

1763+

expect(promotedLine).toBeDefined();

1764+

expect(promotedLine?.length).toBeLessThan(340);

1765+

expect(promotedLine).toContain("...");

1766+

expect(promotedLine).toMatch(

1767+

/\[score=0\.\d{3} recalls=1 avg=0\.\d{3} source=memory\/2026-04-01\.md:1-1\]/,

1768+

);

1769+

expect(memoryText).toMatch(/<!-- openclaw-memory-promotion:[^\n]+ -->/);

1770+

});

1771+

});

1772+16461773

it("does not re-append candidates that were promoted in a prior run", async () => {

16471774

await withTempWorkspace(async (workspaceDir) => {

16481775

await writeDailyMemoryNote(workspaceDir, "2026-04-01", [