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

推荐订阅源

L
LangChain Blog
Recent Announcements
Recent Announcements
GbyAI
GbyAI
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Microsoft Azure Blog
Microsoft Azure Blog
N
Netflix TechBlog - Medium
人人都是产品经理
人人都是产品经理
MongoDB | Blog
MongoDB | Blog
D
DataBreaches.Net
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
WordPress大学
WordPress大学
U
Unit 42
腾讯CDC
D
Docker
The GitHub Blog
The GitHub Blog
阮一峰的网络日志
阮一峰的网络日志
Vercel News
Vercel News
I
InfoQ
Jina AI
Jina AI
爱范儿
爱范儿
宝玉的分享
宝玉的分享
博客园 - Franky
G
Google Developers Blog
P
Proofpoint News 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: tighten acp parent stream assertions · openclaw/ope...
steipete · 2026-05-09 · via Recent Commits to openclaw:main

@@ -54,6 +54,14 @@ function collectedTexts() {

5454

return enqueueSystemEventMock.mock.calls.map((call) => String(call[0] ?? ""));

5555

}

565657+

function expectTextWithFragment(texts: string[], fragment: string): void {

58+

expect(texts.some((text) => text.includes(fragment))).toBe(true);

59+

}

60+61+

function expectNoTextWithFragment(texts: string[], fragment: string): void {

62+

expect(texts.every((text) => !text.includes(fragment))).toBe(true);

63+

}

64+5765

describe("startAcpSpawnParentStreamRelay", () => {

5866

beforeAll(async () => {

5967

({ emitAgentEvent } = await import("../infra/agent-events.js"));

@@ -113,34 +121,34 @@ describe("startAcpSpawnParentStreamRelay", () => {

113121

});

114122115123

const texts = collectedTexts();

116-

expect(texts).toEqual(

117-

expect.arrayContaining([expect.stringContaining("Started codex session")]),

118-

);

119-

expect(texts).toEqual(

120-

expect.arrayContaining([expect.stringContaining("codex: hello from child")]),

121-

);

122-

expect(texts).toEqual(

123-

expect.arrayContaining([expect.stringContaining("codex run completed in 2s")]),

124-

);

124+

expectTextWithFragment(texts, "Started codex session");

125+

expectTextWithFragment(texts, "codex: hello from child");

126+

expectTextWithFragment(texts, "codex run completed in 2s");

125127

expect(

126128

enqueueSystemEventMock.mock.calls.every(

127129

(call) => (call[1] as { trusted?: boolean } | undefined)?.trusted === false,

128130

),

129131

).toBe(true);

130-

expect(enqueueSystemEventMock).toHaveBeenCalledWith(

131-

expect.any(String),

132-

expect.objectContaining({

133-

sessionKey: "agent:main:main",

134-

deliveryContext,

135-

trusted: false,

136-

}),

137-

);

138-

expect(requestHeartbeatMock).toHaveBeenCalledWith(

139-

expect.objectContaining({

140-

reason: "acp:spawn:stream",

141-

sessionKey: "agent:main:main",

142-

}),

143-

);

132+

const systemEventCalls = enqueueSystemEventMock.mock.calls as Array<

133+

[string, { sessionKey?: string; deliveryContext?: unknown; trusted?: boolean }]

134+

>;

135+

expect(

136+

systemEventCalls.some(

137+

([, options]) =>

138+

options.sessionKey === "agent:main:main" &&

139+

options.deliveryContext === deliveryContext &&

140+

options.trusted === false,

141+

),

142+

).toBe(true);

143+

const heartbeatCalls = requestHeartbeatMock.mock.calls as Array<

144+

[{ reason?: string; sessionKey?: string }]

145+

>;

146+

expect(

147+

heartbeatCalls.some(

148+

([options]) =>

149+

options.reason === "acp:spawn:stream" && options.sessionKey === "agent:main:main",

150+

),

151+

).toBe(true);

144152

relay.dispose();

145153

});

146154

@@ -156,9 +164,7 @@ describe("startAcpSpawnParentStreamRelay", () => {

156164

});

157165158166

vi.advanceTimersByTime(1_500);

159-

expect(collectedTexts()).toEqual(

160-

expect.arrayContaining([expect.stringContaining("has produced no output for 1s")]),

161-

);

167+

expectTextWithFragment(collectedTexts(), "has produced no output for 1s");

162168163169

emitAgentEvent({

164170

runId: "run-2",

@@ -170,10 +176,8 @@ describe("startAcpSpawnParentStreamRelay", () => {

170176

vi.advanceTimersByTime(5);

171177172178

const texts = collectedTexts();

173-

expect(texts).toEqual(expect.arrayContaining([expect.stringContaining("resumed output.")]));

174-

expect(texts).toEqual(

175-

expect.arrayContaining([expect.stringContaining("codex: resumed output")]),

176-

);

179+

expectTextWithFragment(texts, "resumed output.");

180+

expectTextWithFragment(texts, "codex: resumed output");

177181178182

emitAgentEvent({

179183

runId: "run-2",

@@ -183,9 +187,7 @@ describe("startAcpSpawnParentStreamRelay", () => {

183187

error: "boom",

184188

},

185189

});

186-

expect(collectedTexts()).toEqual(

187-

expect.arrayContaining([expect.stringContaining("run failed: boom")]),

188-

);

190+

expectTextWithFragment(collectedTexts(), "run failed: boom");

189191

relay.dispose();

190192

});

191193

@@ -201,9 +203,7 @@ describe("startAcpSpawnParentStreamRelay", () => {

201203

});

202204203205

vi.advanceTimersByTime(1_001);

204-

expect(collectedTexts()).toEqual(

205-

expect.arrayContaining([expect.stringContaining("stream relay timed out after 1s")]),

206-

);

206+

expectTextWithFragment(collectedTexts(), "stream relay timed out after 1s");

207207208208

const before = enqueueSystemEventMock.mock.calls.length;

209209

emitAgentEvent({

@@ -228,15 +228,11 @@ describe("startAcpSpawnParentStreamRelay", () => {

228228

emitStartNotice: false,

229229

});

230230231-

expect(collectedTexts()).not.toEqual(

232-

expect.arrayContaining([expect.stringContaining("Started codex session")]),

233-

);

231+

expectNoTextWithFragment(collectedTexts(), "Started codex session");

234232235233

relay.notifyStarted();

236234237-

expect(collectedTexts()).toEqual(

238-

expect.arrayContaining([expect.stringContaining("Started codex session")]),

239-

);

235+

expectTextWithFragment(collectedTexts(), "Started codex session");

240236

relay.dispose();

241237

});

242238

@@ -300,7 +296,7 @@ describe("startAcpSpawnParentStreamRelay", () => {

300296

vi.advanceTimersByTime(15);

301297302298

const texts = collectedTexts();

303-

expect(texts).toEqual(expect.arrayContaining([expect.stringContaining("codex: hello world")]));

299+

expectTextWithFragment(texts, "codex: hello world");

304300

relay.dispose();

305301

});

306302

@@ -325,12 +321,8 @@ describe("startAcpSpawnParentStreamRelay", () => {

325321

vi.advanceTimersByTime(15);

326322327323

const texts = collectedTexts();

328-

expect(texts).not.toEqual(

329-

expect.arrayContaining([expect.stringContaining("checking thread context")]),

330-

);

331-

expect(texts).not.toEqual(

332-

expect.arrayContaining([expect.stringContaining("post a tight progress reply here")]),

333-

);

324+

expectNoTextWithFragment(texts, "checking thread context");

325+

expectNoTextWithFragment(texts, "post a tight progress reply here");

334326

relay.dispose();

335327

});

336328

@@ -363,12 +355,8 @@ describe("startAcpSpawnParentStreamRelay", () => {

363355

vi.advanceTimersByTime(15);

364356365357

const texts = collectedTexts();

366-

expect(texts).not.toEqual(

367-

expect.arrayContaining([expect.stringContaining("checking thread context")]),

368-

);

369-

expect(texts).toEqual(

370-

expect.arrayContaining([expect.stringContaining("codex: final answer ready")]),

371-

);

358+

expectNoTextWithFragment(texts, "checking thread context");

359+

expectTextWithFragment(texts, "codex: final answer ready");

372360

relay.dispose();

373361

});

374362

@@ -392,14 +380,14 @@ describe("startAcpSpawnParentStreamRelay", () => {

392380

expect(readAcpSessionEntryMock).toHaveBeenCalledWith({

393381

sessionKey: "agent:codex:acp:child-1",

394382

});

395-

expect(resolveSessionFilePathMock).toHaveBeenCalledWith(

396-

"sess-123",

397-

expect.objectContaining({

398-

sessionId: "sess-123",

399-

}),

400-

expect.objectContaining({

401-

storePath: "/tmp/openclaw/agents/codex/sessions/sessions.json",

402-

}),

403-

);

383+

expect(resolveSessionFilePathMock).toHaveBeenCalledTimes(1);

384+

const [sessionId, entry, options] = resolveSessionFilePathMock.mock.calls[0] as [

385+

string,

386+

{ sessionId?: unknown },

387+

{ storePath?: unknown },

388+

];

389+

expect(sessionId).toBe("sess-123");

390+

expect(entry.sessionId).toBe("sess-123");

391+

expect(options.storePath).toBe("/tmp/openclaw/agents/codex/sessions/sessions.json");

404392

});

405393

});