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

推荐订阅源

D
Docker
B
Blog RSS Feed
Microsoft Security Blog
Microsoft Security Blog
Y
Y Combinator Blog
N
Netflix TechBlog - Medium
M
MIT News - Artificial intelligence
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
B
Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
C
Check Point Blog
The GitHub Blog
The GitHub Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
P
Proofpoint News Feed
Martin Fowler
Martin Fowler
大猫的无限游戏
大猫的无限游戏
GbyAI
GbyAI
博客园_首页
A
About on SuperTechFans
Blog — PlanetScale
Blog — PlanetScale
人人都是产品经理
人人都是产品经理
T
Tailwind CSS Blog
aimingoo的专栏
aimingoo的专栏
T
The Blog of Author Tim Ferriss
The Cloudflare 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
fix(twitch): export clearRegistryForTest for cross-test i...
clawsweeper · 2026-05-20 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -14,6 +14,7 @@ Docs: https://docs.openclaw.ai

1414

- CLI/message: include a stable top-level `messageId` in `openclaw message --json` output when channel sends return one. (#84191) Thanks @100menotu001.

1515

- Plugins/hooks: apply a default 30-second timeout to `before_compaction` and `after_compaction` hooks so a hung plugin handler no longer blocks compaction completion. (#84153)

1616

- Discord: preserve disabled presentation buttons when adapting and rendering Discord message controls. (#84188) Thanks @100menotu001.

17+

- Twitch: add a test-only client-manager registry reset helper so non-isolated Twitch tests can clear cached managers between cases. Fixes #83887. (#84244) Thanks @hclsys.

1718

- Plugins/perf: thread explicit plugin discovery results through `loadBundledCapabilityRuntimeRegistry`, `resolveBundledPluginSources`, and `listChannelCatalogEntries` so callers that already hold a discovery result skip redundant filesystem walks. Thanks @SebTardif.

1819

- harden update restart script creation [AI]. (#84088) Thanks @pgondhi987.

1920

- Docker: keep the bundled Codex plugin in official release image keep lists so the default OpenAI agent harness remains available after Docker pruning. Fixes #83613. (#83626) Thanks @YuanHanzhong.

Original file line numberDiff line numberDiff line change

@@ -0,0 +1,36 @@

1+

import { afterEach, describe, expect, it, vi } from "vitest";

2+

import {

3+

clearRegistryForTest,

4+

getClientManager,

5+

getOrCreateClientManager,

6+

} from "./client-manager-registry.js";

7+

import type { ChannelLogSink } from "./types.js";

8+
9+

function makeLogger(): ChannelLogSink {

10+

return {

11+

info: vi.fn(),

12+

warn: vi.fn(),

13+

error: vi.fn(),

14+

debug: vi.fn(),

15+

};

16+

}

17+
18+

describe("client manager registry", () => {

19+

afterEach(async () => {

20+

await clearRegistryForTest();

21+

});

22+
23+

it("clears cached managers for hot module test isolation", async () => {

24+

const firstManager = getOrCreateClientManager("default", makeLogger());

25+

const disconnectAll = vi.spyOn(firstManager, "disconnectAll");

26+
27+

expect(getClientManager("default")).toBe(firstManager);

28+

expect(getOrCreateClientManager("default", makeLogger())).toBe(firstManager);

29+
30+

await clearRegistryForTest();

31+
32+

expect(disconnectAll).toHaveBeenCalledOnce();

33+

expect(getClientManager("default")).toBeUndefined();

34+

expect(getOrCreateClientManager("default", makeLogger())).not.toBe(firstManager);

35+

});

36+

});

Original file line numberDiff line numberDiff line change

@@ -85,3 +85,25 @@ export async function removeClientManager(accountId: string): Promise<void> {

8585

registry.delete(accountId);

8686

entry.logger.info(`Unregistered client manager for account: ${accountId}`);

8787

}

88+
89+

/**

90+

* Test-only: clear the module-level registry of all client manager entries.

91+

*

92+

* Mirrors the `clearForTest` escape hatch on `TwitchClientManager`. Without

93+

* this, the module-level `registry` Map survives across tests when vitest

94+

* is run with `--isolate=false` (or any harness that does not tear the

95+

* module graph down between cases), and a stale entry from one test will

96+

* shadow `getOrCreateClientManager` calls in subsequent tests, silently

97+

* handing back another test's mocked logger/manager. See #83887.

98+

*

99+

* Production code MUST NOT call this. It disconnects cached managers before

100+

* clearing the registry so tests do not leave handlers or clients behind.

101+

*/

102+

export async function clearRegistryForTest(): Promise<void> {

103+

const entries = [...registry.values()];

104+

try {

105+

await Promise.all(entries.map((entry) => entry.manager.disconnectAll()));

106+

} finally {

107+

registry.clear();

108+

}

109+

}