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

推荐订阅源

H
Help Net Security
腾讯CDC
爱范儿
爱范儿
Google DeepMind News
Google DeepMind News
V
V2EX
Blog — PlanetScale
Blog — PlanetScale
Engineering at Meta
Engineering at Meta
GbyAI
GbyAI
量子位
F
Fortinet All Blogs
G
Google Developers Blog
T
The Blog of Author Tim Ferriss
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Hugging Face - Blog
Hugging Face - Blog
Last Week in AI
Last Week in AI
T
Tailwind CSS Blog
J
Java Code Geeks
S
SegmentFault 最新的问题
D
Docker
博客园 - 司徒正美
The GitHub Blog
The GitHub Blog
Jina AI
Jina AI
M
MIT News - Artificial intelligence
博客园 - 【当耐特】

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 provider validation assertions · openclaw/o...
shakkernerd · 2026-05-11 · via Recent Commits to openclaw:main

@@ -50,13 +50,13 @@ function normalizeProviderFixture(provider: ProviderPlugin) {

50505151

function expectNormalizedProviderFixture(params: {

5252

provider: ProviderPlugin;

53-

expectedProvider?: Record<string, unknown>;

53+

expectedProvider?: ProviderPlugin | null;

5454

expectedDiagnostics?: ReadonlyArray<{ level: PluginDiagnostic["level"]; message: string }>;

5555

expectedDiagnosticText?: readonly string[];

5656

}) {

5757

const result = normalizeProviderFixture(params.provider);

5858

if (params.expectedProvider) {

59-

expect(result.provider).toMatchObject(params.expectedProvider);

59+

expect(result.provider).toEqual(params.expectedProvider);

6060

}

6161

if (params.expectedDiagnostics) {

6262

expectDiagnosticMessages(result.diagnostics, params.expectedDiagnostics);

@@ -69,19 +69,22 @@ function expectNormalizedProviderFixture(params: {

69697070

function expectProviderNormalizationResult(params: {

7171

provider: ProviderPlugin;

72-

expectedProvider?: Record<string, unknown>;

72+

expectedProvider?: ProviderPlugin | null;

7373

expectedDiagnostics?: ReadonlyArray<{ level: PluginDiagnostic["level"]; message: string }>;

7474

expectedDiagnosticText?: readonly string[];

7575

assert?: (

7676

provider: ReturnType<typeof normalizeRegisteredProvider>,

7777

diagnostics: PluginDiagnostic[],

78+

inputProvider: ProviderPlugin,

7879

) => void;

7980

}) {

8081

const { diagnostics, provider } = expectNormalizedProviderFixture(params);

81-

params.assert?.(provider, diagnostics);

82+

params.assert?.(provider, diagnostics, params.provider);

8283

}

83848485

describe("normalizeRegisteredProvider", () => {

86+

const primaryAuthRun = async () => ({ profiles: [] });

87+8588

it.each([

8689

{

8790

name: "drops invalid and duplicate auth methods, and clears bad wizard method bindings",

@@ -105,7 +108,7 @@ describe("normalizeRegisteredProvider", () => {

105108

message: " Demo models ",

106109

},

107110

},

108-

run: async () => ({ profiles: [] }),

111+

run: primaryAuthRun,

109112

},

110113

{

111114

id: "primary",

@@ -136,6 +139,7 @@ describe("normalizeRegisteredProvider", () => {

136139

{

137140

id: "primary",

138141

label: "Primary",

142+

kind: "custom",

139143

wizard: {

140144

choiceId: "demo-primary",

141145

modelAllowlist: {

@@ -145,6 +149,7 @@ describe("normalizeRegisteredProvider", () => {

145149

message: "Demo models",

146150

},

147151

},

152+

run: primaryAuthRun,

148153

},

149154

],

150155

wizard: {

@@ -218,12 +223,20 @@ describe("normalizeRegisteredProvider", () => {

218223

expectedDiagnosticText: [

219224

'provider "demo" registered both catalog and discovery; using catalog',

220225

],

221-

assert: (provider: ReturnType<typeof normalizeRegisteredProvider>) => {

226+

assert: (

227+

provider: ReturnType<typeof normalizeRegisteredProvider>,

228+

_diagnostics: PluginDiagnostic[],

229+

inputProvider: ProviderPlugin,

230+

) => {

222231

if (!provider) {

223232

throw new Error("expected provider");

224233

}

225-

expect(typeof provider.catalog?.run).toBe("function");

226-

expect(provider.discovery).toBeUndefined();

234+

expect(provider).toEqual({

235+

id: "demo",

236+

label: "Demo",

237+

auth: [],

238+

catalog: inputProvider.catalog,

239+

});

227240

},

228241

},

229242

{

@@ -242,11 +255,20 @@ describe("normalizeRegisteredProvider", () => {

242255

expectedDiagnosticText: [

243256

'provider "legacy-discovery-only" uses deprecated discovery; use catalog',

244257

],

245-

assert: (provider: ReturnType<typeof normalizeRegisteredProvider>) => {

258+

assert: (

259+

provider: ReturnType<typeof normalizeRegisteredProvider>,

260+

_diagnostics: PluginDiagnostic[],

261+

inputProvider: ProviderPlugin,

262+

) => {

246263

if (!provider) {

247264

throw new Error("expected provider");

248265

}

249-

expect(provider).toMatchObject({ discovery: { run: expect.any(Function) } });

266+

expect(provider).toEqual({

267+

id: "legacy-discovery-only",

268+

label: "Demo",

269+

auth: [],

270+

discovery: inputProvider.discovery,

271+

});

250272

},

251273

},

252274

] as const)(