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

推荐订阅源

有赞技术团队
有赞技术团队
小众软件
小众软件
The Cloudflare Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园_首页
酷 壳 – CoolShell
酷 壳 – CoolShell
爱范儿
爱范儿
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
雷峰网
雷峰网
Jina AI
Jina AI
博客园 - 【当耐特】
V
Visual Studio Blog
美团技术团队
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
罗磊的独立博客
大猫的无限游戏
大猫的无限游戏
量子位
IT之家
IT之家
G
Google Developers Blog
V
V2EX
The GitHub Blog
The GitHub Blog
月光博客
月光博客
GbyAI
GbyAI

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
chore(deadcode): remove duplicate compaction provider lis...
vincentkoc · 2026-06-20 · via Recent Commits to openclaw:main

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

44

clearCompactionProviders,

55

getCompactionProvider,

66

getRegisteredCompactionProvider,

7-

listCompactionProviderIds,

87

listRegisteredCompactionProviders,

98

registerCompactionProvider,

109

restoreRegisteredCompactionProviders,

@@ -37,9 +36,13 @@ function requireCompactionProvider(id: string): CompactionProvider {

3736

return provider;

3837

}

393839+

function listCompactionProviderIdsForTest(): string[] {

40+

return listRegisteredCompactionProviders().map((entry) => entry.provider.id);

41+

}

42+4043

describe("compaction provider registry", () => {

4144

it("starts empty", () => {

42-

expect(listCompactionProviderIds()).toStrictEqual([]);

45+

expect(listCompactionProviderIdsForTest()).toStrictEqual([]);

4346

expect(listRegisteredCompactionProviders()).toStrictEqual([]);

4447

});

4548

@@ -68,7 +71,7 @@ describe("compaction provider registry", () => {

6871

registerCompactionProvider(makeProvider("alpha"));

6972

registerCompactionProvider(makeProvider("beta"));

707371-

expect(listCompactionProviderIds()).toEqual(["alpha", "beta"]);

74+

expect(listCompactionProviderIdsForTest()).toEqual(["alpha", "beta"]);

7275

});

73767477

it("lists registered entries with owner metadata", () => {

@@ -91,7 +94,7 @@ describe("compaction provider registry", () => {

9194

expect(getCompactionProvider("a")?.id).toBe("a");

9295

expect(getCompactionProvider("b")?.id).toBe("b");

9396

expect(getCompactionProvider("c")?.id).toBe("c");

94-

expect(listCompactionProviderIds()).toHaveLength(3);

97+

expect(listCompactionProviderIdsForTest()).toHaveLength(3);

9598

});

969997100

it("calls summarize and returns expected result", async () => {

@@ -112,17 +115,17 @@ describe("compaction provider registry", () => {

112115113116

expect(getCompactionProvider("dup")).toBe(second);

114117

expect(getCompactionProvider("dup")?.label).toBe("second-label");

115-

expect(listCompactionProviderIds()).toEqual(["dup"]);

118+

expect(listCompactionProviderIdsForTest()).toEqual(["dup"]);

116119

});

117120118121

describe("lifecycle (clear / restore)", () => {

119122

it("clear removes all providers", () => {

120123

registerCompactionProvider(makeProvider("a"));

121124

registerCompactionProvider(makeProvider("b"));

122-

expect(listCompactionProviderIds()).toHaveLength(2);

125+

expect(listCompactionProviderIdsForTest()).toHaveLength(2);

123126124127

clearCompactionProviders();

125-

expect(listCompactionProviderIds()).toStrictEqual([]);

128+

expect(listCompactionProviderIdsForTest()).toStrictEqual([]);

126129

expect(getCompactionProvider("a")).toBeUndefined();

127130

});

128131

@@ -136,19 +139,19 @@ describe("compaction provider registry", () => {

136139137140

// Register a third provider to change state

138141

registerCompactionProvider(makeProvider("c"));

139-

expect(listCompactionProviderIds()).toHaveLength(3);

142+

expect(listCompactionProviderIdsForTest()).toHaveLength(3);

140143141144

// Restore from snapshot — should have only a and b

142145

restoreRegisteredCompactionProviders(snapshot);

143-

expect(listCompactionProviderIds()).toEqual(["a", "b"]);

146+

expect(listCompactionProviderIdsForTest()).toEqual(["a", "b"]);

144147

expect(getCompactionProvider("c")).toBeUndefined();

145148

expect(getRegisteredCompactionProvider("a")?.ownerPluginId).toBe("p-a");

146149

});

147150148151

it("restore with empty array clears everything", () => {

149152

registerCompactionProvider(makeProvider("x"));

150153

restoreRegisteredCompactionProviders([]);

151-

expect(listCompactionProviderIds()).toStrictEqual([]);

154+

expect(listCompactionProviderIdsForTest()).toStrictEqual([]);

152155

});

153156

});

154157

});