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

推荐订阅源

J
Java Code Geeks
Y
Y Combinator Blog
人人都是产品经理
人人都是产品经理
N
Netflix TechBlog - Medium
Engineering at Meta
Engineering at Meta
量子位
B
Blog
Hugging Face - Blog
Hugging Face - Blog
博客园 - 聂微东
P
Proofpoint News Feed
WordPress大学
WordPress大学
Apple Machine Learning Research
Apple Machine Learning Research
罗磊的独立博客
MongoDB | Blog
MongoDB | Blog
T
Tailwind CSS Blog
博客园 - Franky
博客园 - 司徒正美
Google DeepMind News
Google DeepMind News
D
DataBreaches.Net
M
MIT News - Artificial intelligence
酷 壳 – CoolShell
酷 壳 – CoolShell
爱范儿
爱范儿
T
The Blog of Author Tim Ferriss
B
Blog RSS Feed

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: invoke matrix entry hooks · openclaw/openclaw@24f9f44
steipete · 2026-05-08 · via Recent Commits to openclaw:main

@@ -9,6 +9,9 @@ const cliMocks = vi.hoisted(() => ({

991010

const runtimeMocks = vi.hoisted(() => ({

1111

ensureMatrixCryptoRuntime: vi.fn(async () => {}),

12+

handleMatrixSubagentDeliveryTarget: vi.fn(() => "delivery-target"),

13+

handleMatrixSubagentEnded: vi.fn(async () => {}),

14+

handleMatrixSubagentSpawning: vi.fn(async () => "spawned"),

1215

handleVerificationBootstrap: vi.fn(async () => {}),

1316

handleVerificationStatus: vi.fn(async () => {}),

1417

handleVerifyRecoveryKey: vi.fn(async () => {}),

@@ -23,6 +26,7 @@ vi.mock("./src/cli.js", () => {

23262427

vi.mock("./plugin-entry.handlers.runtime.js", () => runtimeMocks);

2528

vi.mock("./runtime-setter-api.js", () => ({ setMatrixRuntime: runtimeMocks.setMatrixRuntime }));

29+

vi.mock("./src/matrix/subagent-hooks.js", () => runtimeMocks);

26302731

describe("matrix plugin", () => {

2832

it("registers matrix CLI through a descriptor-backed lazy registrar", async () => {

@@ -68,7 +72,10 @@ describe("matrix plugin", () => {

6872

expect(entry.kind).toBe("bundled-channel-entry");

6973

expect(entry.id).toBe("matrix");

7074

expect(entry.name).toBe("Matrix");

71-

expect(entry.setChannelRuntime).toEqual(expect.any(Function));

75+

if (!entry.setChannelRuntime) {

76+

throw new Error("expected Matrix runtime setter");

77+

}

78+

expect(() => entry.setChannelRuntime?.({ marker: "runtime" } as never)).not.toThrow();

7279

});

73807481

it("wires CLI metadata through the bundled entry", () => {

@@ -99,7 +106,7 @@ describe("matrix plugin", () => {

99106

expect(registerGatewayMethod).not.toHaveBeenCalled();

100107

});

101108102-

it("registers subagent lifecycle hooks during full runtime registration", () => {

109+

it("registers subagent lifecycle hooks during full runtime registration", async () => {

103110

const on = vi.fn();

104111

const registerGatewayMethod = vi.fn();

105112

const api = createTestPluginApi({

@@ -121,8 +128,14 @@ describe("matrix plugin", () => {

121128

"subagent_ended",

122129

"subagent_delivery_target",

123130

]);

124-

for (const [, handler] of on.mock.calls) {

125-

expect(handler).toEqual(expect.any(Function));

126-

}

131+

const handlers = Object.fromEntries(on.mock.calls);

132+

await expect(handlers.subagent_spawning({ id: "spawn" })).resolves.toBe("spawned");

133+

await expect(handlers.subagent_ended({ id: "ended" })).resolves.toBeUndefined();

134+

await expect(handlers.subagent_delivery_target({ id: "target" })).resolves.toBe(

135+

"delivery-target",

136+

);

137+

expect(runtimeMocks.handleMatrixSubagentSpawning).toHaveBeenCalledWith(api, { id: "spawn" });

138+

expect(runtimeMocks.handleMatrixSubagentEnded).toHaveBeenCalledWith({ id: "ended" });

139+

expect(runtimeMocks.handleMatrixSubagentDeliveryTarget).toHaveBeenCalledWith({ id: "target" });

127140

});

128141

});