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

推荐订阅源

Martin Fowler
Martin Fowler
D
DataBreaches.Net
F
Fortinet All Blogs
阮一峰的网络日志
阮一峰的网络日志
博客园_首页
Apple Machine Learning Research
Apple Machine Learning Research
H
Help Net Security
M
MIT News - Artificial intelligence
美团技术团队
人人都是产品经理
人人都是产品经理
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
The Cloudflare Blog
有赞技术团队
有赞技术团队
L
LangChain Blog
博客园 - Franky
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 【当耐特】
S
SegmentFault 最新的问题
V
Visual Studio Blog
Blog — PlanetScale
Blog — PlanetScale
Hugging Face - Blog
Hugging Face - Blog
B
Blog
I
InfoQ

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
Fail closed when an explicit agent harness is missing (#7...
pashpashpash · 2026-04-25 · via Recent Commits to openclaw:main

@@ -100,15 +100,36 @@ function registerFailingCodexHarness(): void {

100100

}

101101102102

describe("runAgentHarnessAttemptWithFallback", () => {

103-

it("falls back to the PI harness when a forced plugin harness is unavailable", async () => {

103+

it("fails when a forced plugin harness is unavailable and fallback is omitted", async () => {

104104

process.env.OPENCLAW_AGENT_RUNTIME = "codex";

105105106+

await expect(runAgentHarnessAttemptWithFallback(createAttemptParams())).rejects.toThrow(

107+

'Requested agent harness "codex" is not registered and PI fallback is disabled.',

108+

);

109+

expect(piRunAttempt).not.toHaveBeenCalled();

110+

});

111+112+

it("falls back to the PI harness for a forced plugin harness only when explicitly configured", async () => {

113+

process.env.OPENCLAW_AGENT_RUNTIME = "codex";

114+

process.env.OPENCLAW_AGENT_HARNESS_FALLBACK = "pi";

115+106116

const result = await runAgentHarnessAttemptWithFallback(createAttemptParams());

107117108118

expect(result.sessionIdUsed).toBe("pi");

109119

expect(piRunAttempt).toHaveBeenCalledTimes(1);

110120

});

111121122+

it("does not inherit config fallback when env forces a plugin harness", async () => {

123+

process.env.OPENCLAW_AGENT_RUNTIME = "codex";

124+125+

await expect(

126+

runAgentHarnessAttemptWithFallback(

127+

createAttemptParams({ agents: { defaults: { embeddedHarness: { fallback: "pi" } } } }),

128+

),

129+

).rejects.toThrow('Requested agent harness "codex" is not registered');

130+

expect(piRunAttempt).not.toHaveBeenCalled();

131+

});

132+112133

it("falls back to the PI harness in auto mode when no plugin harness matches", async () => {

113134

process.env.OPENCLAW_AGENT_RUNTIME = "auto";

114135

@@ -177,6 +198,56 @@ describe("runAgentHarnessAttemptWithFallback", () => {

177198

).rejects.toThrow("PI fallback is disabled");

178199

expect(piRunAttempt).not.toHaveBeenCalled();

179200

});

201+202+

it("fails for config-forced plugin harnesses when fallback is omitted", async () => {

203+

await expect(

204+

runAgentHarnessAttemptWithFallback(

205+

createAttemptParams({ agents: { defaults: { embeddedHarness: { runtime: "codex" } } } }),

206+

),

207+

).rejects.toThrow('Requested agent harness "codex" is not registered');

208+

expect(piRunAttempt).not.toHaveBeenCalled();

209+

});

210+211+

it("allows config-forced plugin harnesses to opt into PI fallback", async () => {

212+

const result = await runAgentHarnessAttemptWithFallback(

213+

createAttemptParams({

214+

agents: { defaults: { embeddedHarness: { runtime: "codex", fallback: "pi" } } },

215+

}),

216+

);

217+218+

expect(result.sessionIdUsed).toBe("pi");

219+

expect(piRunAttempt).toHaveBeenCalledTimes(1);

220+

});

221+222+

it("does not inherit default fallback when an agent forces a plugin harness", async () => {

223+

await expect(

224+

runAgentHarnessAttemptWithFallback({

225+

...createAttemptParams({

226+

agents: {

227+

defaults: { embeddedHarness: { fallback: "pi" } },

228+

list: [{ id: "strict", embeddedHarness: { runtime: "codex" } }],

229+

},

230+

}),

231+

sessionKey: "agent:strict:session-1",

232+

}),

233+

).rejects.toThrow('Requested agent harness "codex" is not registered');

234+

expect(piRunAttempt).not.toHaveBeenCalled();

235+

});

236+237+

it("lets an agent-forced plugin harness opt into PI fallback", async () => {

238+

const result = await runAgentHarnessAttemptWithFallback({

239+

...createAttemptParams({

240+

agents: {

241+

defaults: { embeddedHarness: { fallback: "none" } },

242+

list: [{ id: "strict", embeddedHarness: { runtime: "codex", fallback: "pi" } }],

243+

},

244+

}),

245+

sessionKey: "agent:strict:session-1",

246+

});

247+248+

expect(result.sessionIdUsed).toBe("pi");

249+

expect(piRunAttempt).toHaveBeenCalledTimes(1);

250+

});

180251

});

181252182253

describe("selectAgentHarness", () => {