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

推荐订阅源

钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
G
Google Developers Blog
小众软件
小众软件
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园 - 【当耐特】
爱范儿
爱范儿
博客园 - 聂微东
美团技术团队
大猫的无限游戏
大猫的无限游戏
The Cloudflare Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
有赞技术团队
有赞技术团队
云风的 BLOG
云风的 BLOG
罗磊的独立博客
V
Visual Studio Blog
WordPress大学
WordPress大学
Stack Overflow Blog
Stack Overflow Blog
雷峰网
雷峰网
人人都是产品经理
人人都是产品经理
Blog — PlanetScale
Blog — PlanetScale
V
V2EX
The GitHub Blog
The GitHub Blog
Apple Machine Learning Research
Apple Machine Learning Research
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报

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 stream resolution assertions · openclaw/ope...
steipete · 2026-05-11 · via Recent Commits to openclaw:main

@@ -29,6 +29,22 @@ const overrideBoundaryAwareStreamFnOnce = (streamFn: StreamFn): void => {

2929

);

3030

};

313132+

function requireRecord(value: unknown, label: string): Record<string, unknown> {

33+

expect(value).toBeTypeOf("object");

34+

expect(value).not.toBeNull();

35+

if (!value || typeof value !== "object" || Array.isArray(value)) {

36+

throw new Error(`expected ${label} to be an object`);

37+

}

38+

return value as Record<string, unknown>;

39+

}

40+41+

async function expectStreamResultRecord(

42+

result: ReturnType<StreamFn>,

43+

label: string,

44+

): Promise<Record<string, unknown>> {

45+

return requireRecord(await result, label);

46+

}

47+3248

afterEach(() => {

3349

__testing.resetPiNativeCodexResponsesStreamFnForTest();

3450

});

@@ -147,16 +163,16 @@ describe("resolveEmbeddedAgentStreamFn", () => {

147163

});

148164149165

expect(streamFn).not.toBe(streamSimple);

150-

await expect(

166+

const result = await expectStreamResultRecord(

151167

streamFn(

152168

{ provider: "openai-codex", id: "codex-mini-latest" } as never,

153169

{ systemPrompt: `intro${SYSTEM_PROMPT_CACHE_BOUNDARY}tail` } as never,

154170

{},

155171

),

156-

).resolves.toMatchObject({

157-

context: { systemPrompt: "intro\ntail" },

158-

options: { apiKey: "oauth-bearer-token" },

159-

});

172+

"codex native result",

173+

);

174+

expect(requireRecord(result.context, "codex native context").systemPrompt).toBe("intro\ntail");

175+

expect(requireRecord(result.options, "codex native options").apiKey).toBe("oauth-bearer-token");

160176

expect(nativeStreamFn).toHaveBeenCalledTimes(1);

161177

});

162178

@@ -194,9 +210,11 @@ describe("resolveEmbeddedAgentStreamFn", () => {

194210

});

195211196212

expect(streamFn).not.toBe(nativeStreamFn);

197-

await expect(

213+

const result = await expectStreamResultRecord(

198214

streamFn({ provider: "llama", id: "qwen36-35b-a3b" } as never, {} as never, {}),

199-

).resolves.toMatchObject({ apiKey: "local-token" });

215+

"openai compatible result",

216+

);

217+

expect(result.apiKey).toBe("local-token");

200218

expect(innerStreamFn).toHaveBeenCalledTimes(1);

201219

});

202220

@@ -217,13 +235,15 @@ describe("resolveEmbeddedAgentStreamFn", () => {

217235

});

218236219237

expect(streamFn).not.toBe(currentStreamFn);

220-

await expect(

238+

const result = await expectStreamResultRecord(

221239

streamFn(

222240

{ provider: "cloudflare-ai-gateway", id: "claude-sonnet-4-6" } as never,

223241

{} as never,

224242

{},

225243

),

226-

).resolves.toMatchObject({ apiKey: "anthropic-runtime-key" });

244+

"runtime auth result",

245+

);

246+

expect(result.apiKey).toBe("anthropic-runtime-key");

227247

expect(currentStreamFn).not.toHaveBeenCalled();

228248

expect(innerStreamFn).toHaveBeenCalledTimes(1);

229249

});

@@ -246,11 +266,11 @@ describe("resolveEmbeddedAgentStreamFn", () => {

246266

authStorage,

247267

});

248268249-

await expect(

269+

const result = await expectStreamResultRecord(

250270

streamFn({ provider: "openai", id: "gpt-5.4" } as never, {} as never, {}),

251-

).resolves.toMatchObject({

252-

apiKey: "resolved-key",

253-

});

271+

"provider-owned result",

272+

);

273+

expect(result.apiKey).toBe("resolved-key");

254274

expect(authStorage.getApiKey).not.toHaveBeenCalled();

255275

expect(providerStreamFn).toHaveBeenCalledTimes(1);

256276

});

@@ -271,11 +291,11 @@ describe("resolveEmbeddedAgentStreamFn", () => {

271291

resolvedApiKey: "resolved-key",

272292

});

273293274-

await expect(

294+

const result = await expectStreamResultRecord(

275295

streamFn({ provider: "github-copilot", id: "gpt-5.4" } as never, {} as never, {}),

276-

).resolves.toMatchObject({

277-

signal,

278-

});

296+

"provider-owned signal result",

297+

);

298+

expect(result.signal).toBe(signal);

279299

});

280300281301

it("does not overwrite an explicit provider-owned stream signal", async () => {

@@ -294,13 +314,13 @@ describe("resolveEmbeddedAgentStreamFn", () => {

294314

} as never,

295315

});

296316297-

await expect(

317+

const result = await expectStreamResultRecord(

298318

streamFn({ provider: "github-copilot", id: "gpt-5.4" } as never, {} as never, {

299319

signal: explicitSignal,

300320

}),

301-

).resolves.toMatchObject({

302-

signal: explicitSignal,

303-

});

321+

"provider-owned explicit signal result",

322+

);

323+

expect(result.signal).toBe(explicitSignal);

304324

});

305325306326

it("injects the resolved run api key into the PI native Codex Responses fallback", async () => {

@@ -317,9 +337,11 @@ describe("resolveEmbeddedAgentStreamFn", () => {

317337

resolvedApiKey: "oauth-bearer-token",

318338

});

319339320-

await expect(

340+

const result = await expectStreamResultRecord(

321341

streamFn({ provider: "openai-codex", id: "gpt-5.5" } as never, {} as never, {}),

322-

).resolves.toMatchObject({ apiKey: "oauth-bearer-token" });

342+

"codex api key result",

343+

);

344+

expect(result.apiKey).toBe("oauth-bearer-token");

323345

expect(nativeStreamFn).toHaveBeenCalledTimes(1);

324346

});

325347

@@ -340,9 +362,11 @@ describe("resolveEmbeddedAgentStreamFn", () => {

340362

authStorage,

341363

});

342364343-

await expect(

365+

const result = await expectStreamResultRecord(

344366

streamFn({ provider: "openai-codex", id: "gpt-5.5" } as never, {} as never, {}),

345-

).resolves.toMatchObject({ apiKey: "stored-bearer-token" });

367+

"codex stored api key result",

368+

);

369+

expect(result.apiKey).toBe("stored-bearer-token");

346370

expect(authStorage.getApiKey).toHaveBeenCalledWith("openai-codex");

347371

});

348372

@@ -362,9 +386,12 @@ describe("resolveEmbeddedAgentStreamFn", () => {

362386

resolvedApiKey: "oauth-bearer-token",

363387

});

364388365-

await expect(

389+

const result = await expectStreamResultRecord(

366390

streamFn({ provider: "openai-codex", id: "gpt-5.5" } as never, {} as never, {}),

367-

).resolves.toMatchObject({ signal: runSignal, apiKey: "oauth-bearer-token" });

391+

"codex signal and api key result",

392+

);

393+

expect(result.signal).toBe(runSignal);

394+

expect(result.apiKey).toBe("oauth-bearer-token");

368395

});

369396370397

it("does not overwrite an explicit signal on the PI native fallback path", async () => {

@@ -384,11 +411,13 @@ describe("resolveEmbeddedAgentStreamFn", () => {

384411

resolvedApiKey: "oauth-bearer-token",

385412

});

386413387-

await expect(

414+

const result = await expectStreamResultRecord(

388415

streamFn({ provider: "openai-codex", id: "gpt-5.5" } as never, {} as never, {

389416

signal: explicitSignal,

390417

}),

391-

).resolves.toMatchObject({ signal: explicitSignal });

418+

"codex explicit signal result",

419+

);

420+

expect(result.signal).toBe(explicitSignal);

392421

});

393422394423

it("forwards the run signal on the sync PI native fallback path without auth credentials", async () => {

@@ -406,9 +435,11 @@ describe("resolveEmbeddedAgentStreamFn", () => {

406435

} as never,

407436

});

408437409-

await expect(

438+

const result = await expectStreamResultRecord(

410439

streamFn({ provider: "openai-codex", id: "gpt-5.5" } as never, {} as never, {}),

411-

).resolves.toMatchObject({ signal: runSignal });

440+

"codex unauthenticated signal result",

441+

);

442+

expect(result.signal).toBe(runSignal);

412443

});

413444414445

it("strips cache boundary markers on the PI native fallback path", async () => {

@@ -426,8 +457,10 @@ describe("resolveEmbeddedAgentStreamFn", () => {

426457

});

427458428459

const systemPrompt = `intro${SYSTEM_PROMPT_CACHE_BOUNDARY}tail`;

429-

await expect(

460+

const result = await expectStreamResultRecord(

430461

streamFn({ provider: "openai-codex", id: "gpt-5.5" } as never, { systemPrompt } as never, {}),

431-

).resolves.toMatchObject({ systemPrompt: "intro\ntail" });

462+

"codex stripped context result",

463+

);

464+

expect(result.systemPrompt).toBe("intro\ntail");

432465

});

433466

});