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

推荐订阅源

Y
Y Combinator Blog
D
Docker
有赞技术团队
有赞技术团队
D
DataBreaches.Net
The GitHub Blog
The GitHub Blog
爱范儿
爱范儿
H
Help Net Security
美团技术团队
MyScale Blog
MyScale Blog
B
Blog RSS Feed
C
Check Point Blog
Microsoft Security Blog
Microsoft Security Blog
阮一峰的网络日志
阮一峰的网络日志
A
About on SuperTechFans
小众软件
小众软件
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
GbyAI
GbyAI
G
Google Developers Blog
月光博客
月光博客
Google DeepMind News
Google DeepMind News
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Blog — PlanetScale
Blog — PlanetScale
MongoDB | Blog
MongoDB | Blog
F
Fortinet All Blogs

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: tighten before agent start assertions · openclaw/op...
shakkernerd · 2026-05-11 · via Recent Commits to openclaw:main

@@ -27,6 +27,15 @@ function addBeforeAgentStartHook(

2727

}

28282929

const stubCtx = TEST_PLUGIN_AGENT_CTX;

30+

const EMPTY_BEFORE_AGENT_START_RESULT = {

31+

appendContext: undefined,

32+

appendSystemContext: undefined,

33+

modelOverride: undefined,

34+

prependContext: undefined,

35+

prependSystemContext: undefined,

36+

providerOverride: undefined,

37+

systemPrompt: undefined,

38+

} satisfies PluginHookBeforeAgentStartResult;

30393140

describe("before_agent_start hook merger", () => {

3241

let registry: PluginRegistry;

@@ -53,10 +62,10 @@ describe("before_agent_start hook merger", () => {

5362

result: PluginHookBeforeAgentStartResult;

5463

priority?: number;

5564

}>,

56-

expected: Partial<PluginHookBeforeAgentStartResult>,

65+

expected: PluginHookBeforeAgentStartResult,

5766

) => {

5867

const result = await runWithHooks(hooks);

59-

expect(result).toEqual(expect.objectContaining(expected));

68+

expect(result).toEqual(expected);

6069

return result;

6170

};

6271

@@ -80,13 +89,15 @@ describe("before_agent_start hook merger", () => {

8089

"returns modelOverride from a single plugin",

8190

{ modelOverride: "llama3.3:8b" },

8291

{

92+

...EMPTY_BEFORE_AGENT_START_RESULT,

8393

modelOverride: "llama3.3:8b",

8494

},

8595

],

8696

[

8797

"returns providerOverride from a single plugin",

8898

{ providerOverride: "ollama" },

8999

{

100+

...EMPTY_BEFORE_AGENT_START_RESULT,

90101

providerOverride: "ollama",

91102

},

92103

],

@@ -97,6 +108,7 @@ describe("before_agent_start hook merger", () => {

97108

providerOverride: "ollama",

98109

},

99110

{

111+

...EMPTY_BEFORE_AGENT_START_RESULT,

100112

modelOverride: "llama3.3:8b",

101113

providerOverride: "ollama",

102114

},

@@ -109,6 +121,7 @@ describe("before_agent_start hook merger", () => {

109121

providerOverride: "ollama",

110122

},

111123

{

124+

...EMPTY_BEFORE_AGENT_START_RESULT,

112125

systemPrompt: "You are a helpful assistant",

113126

modelOverride: "llama3.3:8b",

114127

providerOverride: "ollama",

@@ -124,7 +137,7 @@ describe("before_agent_start hook merger", () => {

124137

{ pluginId: "low-priority", result: { modelOverride: "gpt-5.4" }, priority: 1 },

125138

{ pluginId: "high-priority", result: { modelOverride: "llama3.3:8b" }, priority: 10 },

126139

],

127-

{ modelOverride: "llama3.3:8b" },

140+

{ ...EMPTY_BEFORE_AGENT_START_RESULT, modelOverride: "llama3.3:8b" },

128141

);

129142

expect(result?.modelOverride).toBe("llama3.3:8b");

130143

});

@@ -204,6 +217,6 @@ describe("before_agent_start hook merger", () => {

204217

const runner = createHookRunner(registry);

205218

await runner.runBeforeAgentStart({ prompt: "test" }, stubCtx);

206219207-

expect(capturedCtx).toMatchObject({ runId: "test-run-id" });

220+

expect(capturedCtx).toBe(stubCtx);

208221

});

209222

});