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

推荐订阅源

OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园_首页
雷峰网
雷峰网
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
WordPress大学
WordPress大学
腾讯CDC
T
Tailwind CSS Blog
A
About on SuperTechFans
H
Hackread – Cybersecurity News, Data Breaches, AI and More
The GitHub Blog
The GitHub Blog
T
The Blog of Author Tim Ferriss
G
Google Developers Blog
The Cloudflare Blog
D
DataBreaches.Net
Recent Announcements
Recent Announcements
Engineering at Meta
Engineering at Meta
B
Blog
博客园 - 聂微东
阮一峰的网络日志
阮一峰的网络日志
月光博客
月光博客
博客园 - 司徒正美
MongoDB | Blog
MongoDB | Blog
Google DeepMind News
Google DeepMind News
Apple Machine Learning Research
Apple Machine Learning Research

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 lobster runner assertions · openclaw/opencl...
steipete · 2026-05-10 · via Recent Commits to openclaw:main

@@ -42,6 +42,30 @@ function createUniqueResponseSchema(index: number) {

4242

};

4343

}

444445+

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

46+

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

47+

throw new Error(`expected ${label} to be a record`);

48+

}

49+

return value as Record<string, unknown>;

50+

}

51+52+

function requireFirstCallParam(calls: ReadonlyArray<readonly unknown[]>, label: string) {

53+

const call = calls[0];

54+

if (!call) {

55+

throw new Error(`expected ${label} call`);

56+

}

57+

return call[0];

58+

}

59+60+

function expectToolContext(value: unknown, expected: { cwd?: string; mode: "tool" }) {

61+

const ctx = requireRecord(value, "tool context");

62+

if (expected.cwd !== undefined) {

63+

expect(ctx.cwd).toBe(expected.cwd);

64+

}

65+

expect(ctx.mode).toBe(expected.mode);

66+

expect(ctx.signal).toBeInstanceOf(AbortSignal);

67+

}

68+4569

describe("resolveLobsterCwd", () => {

4670

it("defaults to the current working directory", () => {

4771

expect(resolveLobsterCwd(undefined)).toBe(process.cwd());

@@ -84,14 +108,12 @@ describe("createEmbeddedLobsterRunner", () => {

84108

});

8510986110

expect(runtime.runToolRequest).toHaveBeenCalledTimes(1);

87-

expect(runtime.runToolRequest).toHaveBeenCalledWith({

88-

pipeline: "exec --json=true echo hi",

89-

ctx: expect.objectContaining({

90-

cwd: process.cwd(),

91-

mode: "tool",

92-

signal: expect.any(AbortSignal),

93-

}),

94-

});

111+

const request = requireRecord(

112+

requireFirstCallParam(runtime.runToolRequest.mock.calls, "run tool request"),

113+

"run tool request",

114+

);

115+

expect(request.pipeline).toBe("exec --json=true echo hi");

116+

expectToolContext(request.ctx, { cwd: process.cwd(), mode: "tool" });

95117

expect(envelope).toEqual({

96118

ok: true,

97119

status: "ok",

@@ -130,14 +152,14 @@ describe("createEmbeddedLobsterRunner", () => {

130152

maxStdoutBytes: 4096,

131153

});

132154133-

expect(runtime.runToolRequest).toHaveBeenCalledWith({

134-

filePath: workflowPath,

135-

args: { limit: 3 },

136-

ctx: expect.objectContaining({

137-

cwd: tempDir,

138-

mode: "tool",

139-

}),

140-

});

155+

expect(runtime.runToolRequest).toHaveBeenCalledOnce();

156+

const request = requireRecord(

157+

requireFirstCallParam(runtime.runToolRequest.mock.calls, "workflow run tool request"),

158+

"workflow run tool request",

159+

);

160+

expect(request.filePath).toBe(workflowPath);

161+

expect(request.args).toEqual({ limit: 3 });

162+

expectToolContext(request.ctx, { cwd: tempDir, mode: "tool" });

141163

} finally {

142164

await fs.rm(tempDir, { recursive: true, force: true });

143165

}

@@ -257,15 +279,14 @@ describe("createEmbeddedLobsterRunner", () => {

257279

maxStdoutBytes: 4096,

258280

});

259281260-

expect(runtime.resumeToolRequest).toHaveBeenCalledWith({

261-

token: "resume-token",

262-

approved: false,

263-

ctx: expect.objectContaining({

264-

cwd: process.cwd(),

265-

mode: "tool",

266-

signal: expect.any(AbortSignal),

267-

}),

268-

});

282+

expect(runtime.resumeToolRequest).toHaveBeenCalledOnce();

283+

const request = requireRecord(

284+

requireFirstCallParam(runtime.resumeToolRequest.mock.calls, "resume tool request"),

285+

"resume tool request",

286+

);

287+

expect(request.token).toBe("resume-token");

288+

expect(request.approved).toBe(false);

289+

expectToolContext(request.ctx, { cwd: process.cwd(), mode: "tool" });

269290

expect(envelope).toEqual({

270291

ok: true,

271292

status: "cancelled",

@@ -299,11 +320,14 @@ describe("createEmbeddedLobsterRunner", () => {

299320

maxStdoutBytes: 4096,

300321

});

301322302-

expect(runtime.resumeToolRequest).toHaveBeenCalledWith({

303-

approvalId: "dbc98d05",

304-

approved: true,

305-

ctx: expect.objectContaining({ mode: "tool" }),

306-

});

323+

expect(runtime.resumeToolRequest).toHaveBeenCalledOnce();

324+

const request = requireRecord(

325+

requireFirstCallParam(runtime.resumeToolRequest.mock.calls, "approval resume tool request"),

326+

"approval resume tool request",

327+

);

328+

expect(request.approvalId).toBe("dbc98d05");

329+

expect(request.approved).toBe(true);

330+

expectToolContext(request.ctx, { mode: "tool" });

307331

});

308332309333

it("passes approvalId through the normalized needs_approval envelope", async () => {