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

推荐订阅源

H
Hacker News: Front Page
S
Secure Thoughts
N
News | PayPal Newsroom
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
T
Threatpost
N
News and Events Feed by Topic
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
A
Arctic Wolf
Cisco Talos Blog
Cisco Talos Blog
V2EX - 技术
V2EX - 技术
L
LINUX DO - 热门话题
C
Cyber Attacks, Cyber Crime and Cyber Security
P
Proofpoint News Feed
TaoSecurity Blog
TaoSecurity Blog
N
News and Events Feed by Topic
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Hacker News - Newest:
Hacker News - Newest: "LLM"
NISL@THU
NISL@THU
H
Heimdal Security Blog
Webroot Blog
Webroot Blog
Martin Fowler
Martin Fowler
The Hacker News
The Hacker News
Engineering at Meta
Engineering at Meta
MongoDB | Blog
MongoDB | Blog
A
About on SuperTechFans
Stack Overflow Blog
Stack Overflow Blog
B
Blog RSS Feed
Vercel News
Vercel News
Blog — PlanetScale
Blog — PlanetScale
Google Online Security Blog
Google Online Security Blog
Schneier on Security
Schneier on Security
Cyberwarzone
Cyberwarzone
小众软件
小众软件
V
V2EX
K
Kaspersky official blog
Security Archives - TechRepublic
Security Archives - TechRepublic
博客园 - 三生石上(FineUI控件)
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
C
Cisco Blogs
S
Schneier on Security
Recorded Future
Recorded Future
阮一峰的网络日志
阮一峰的网络日志
AI
AI
Microsoft Security Blog
Microsoft Security Blog
H
Help Net Security
Simon Willison's Weblog
Simon Willison's Weblog
I
InfoQ
G
Google Developers Blog
博客园_首页
Hugging Face - Blog
Hugging Face - Blog

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: trim doctor command hotspots · openclaw/openclaw@c66f16a test: isolate agent auth and spawn hotspots · openclaw/openclaw@9285935 test: stabilize MCP startup disposal race · openclaw/openclaw@dd9d2eb test: merge browser contract server suites · openclaw/openclaw@5817a76 test: narrow ollama provider discovery setup · openclaw/openclaw@a0d9598 build: declare qa-lab aimock runtime dependency · openclaw/openclaw@24431e5 test: speed up safe-bins exec harness · openclaw/openclaw@ee856ab test: preserve tool helpers in embedded runner mocks · openclaw/openclaw@acd86a0 refactor: move memory embeddings into provider plugins · openclaw/openclaw@77e6e4c test: reuse system-run temp fixtures · openclaw/openclaw@7e9ff0f test: trim hotspot wait overhead · openclaw/openclaw@12a59b0 Check: avoid duplicate boundary prep · openclaw/openclaw@baf11b8 test: reduce hotspot fixture overhead · openclaw/openclaw@3a59edd feat(ui): overhaul settings and slash command UX (#67819) thanks @Bun… · openclaw/openclaw@2cfb660 QA Matrix: exit cleanly on failure · openclaw/openclaw@42805d2 QA Matrix: isolate scenario coverage · openclaw/openclaw@7e659e1 Matrix: refresh crypto bootstrap state · openclaw/openclaw@94081d8 QA Lab: add provider registry · openclaw/openclaw@bb7e982 Matrix: add plugin changelog · openclaw/openclaw@4acab55 test: trim more hotspot overhead · openclaw/openclaw@f485311 test: trim remaining hotspot tests · openclaw/openclaw@6ba8626 test: narrow hotspot mocks · openclaw/openclaw@dbc8179 test: isolate gemini embedding request helpers · openclaw/openclaw@cd330f5 test: trim memory and mcp hotspots · openclaw/openclaw@fd48dfa test: slim provider registry mocks · openclaw/openclaw@2e08c77 test: harden Parallels update smoke · openclaw/openclaw@1a98090 feat: default Anthropic to Opus 4.7 · openclaw/openclaw@628b454 fix: harden node-host shell payload mutability checks · openclaw/openclaw@75c551e fix: land node-host approval binding for native binaries (#66731) (th… · openclaw/openclaw@29919bb CI: add daily schedule to CodeQL workflow (#67645) · openclaw/openclaw@69d25f5 fix(gateway): capture config hash after plugin auto-enable to prevent… · openclaw/openclaw@8c11210 fix: repair sanitized replay tool results before send (#67620) (thank… · openclaw/openclaw@c3c7a99 fix: restrict HTML timeout short-circuit to transient statuses · openclaw/openclaw@de129a6 fix: keep TUI watchdog bound to active run (#67401) (thanks @xantorres) · openclaw/openclaw@3525273 Gateway/skills: dedupe skills prefix-match + drop dead fallback on log · openclaw/openclaw@d7f489f Extensions/lmstudio: back off inference preload after consecutive fai… · openclaw/openclaw@b555214 TUI/streaming: add watchdog that resets the activity indicator after … · openclaw/openclaw@f44ab20 Agents/tool-loop: enable unknown-tool stream guard by default · openclaw/openclaw@36ed367 Gateway/skills: invalidate session skills snapshot on config write · openclaw/openclaw@b23d59a fix: classify HTML provider error pages correctly (#67642) (thanks @s… · openclaw/openclaw@e588e90 fix(skills): remove unused model-usage import (#67641) · openclaw/openclaw@55f05df docs(changelog): credit codex fix superseded PRs · openclaw/openclaw@e485f24 fix(openai-codex): normalize stale transport metadata in resolution a… · openclaw/openclaw@90801ba CI: pin Docker-related GitHub Actions (#67632) · openclaw/openclaw@f697b01 Android: modernize WebView and discovery API usage (#67627) · openclaw/openclaw@44a6e50 fix(deps): bump hono to 4.12.14 and @hono/node-server to 1.19.14 (GHS… · openclaw/openclaw@fbccc18 fix(deps): bump dompurify to 3.4.0 (#67614) · openclaw/openclaw@2c2dc00 CI: add explicit permissions to all workflow jobs (fixes code-scannin… · openclaw/openclaw@01b7516 fix: register bundled TTS providers and route overrides correctly (#6… · openclaw/openclaw@6ea3cdd fix: align host tilde paths with OS home (#62804) (thanks @stainlu) · openclaw/openclaw@ecfaf64 fix: flush creds queue before reconnect socket open (#67464) (thanks … · openclaw/openclaw@405c63f fix: strip standalone <function> tool call tags from visible text (#6… · openclaw/openclaw@78df859 fix(agents): preserve cli session metadata before transcript persist … · openclaw/openclaw@898fd04 docs(changelog): move cli transcript entry · openclaw/openclaw@c1817c6 fix(agents): normalize cli transcript api field · openclaw/openclaw@3a3fae0 docs(changelog): note cli transcript persistence · openclaw/openclaw@6c343f1 fix(agents): persist cli transcript turns · openclaw/openclaw@b8ef507 fix(msteams): harden security-sensitive flows (#65841) · openclaw/openclaw@c56b56e [Dashboard] Fix exec approval modal overflow for long command content… · openclaw/openclaw@053c5b0 Docs: remove QA changelog entry · openclaw/openclaw@7fd5771 QA: fix private runtime source loading (#67428) · openclaw/openclaw@d5933af docs(gateway): correct protocol.md schema path, hello-ok example, aut… · openclaw/openclaw@489404d CI: pin Node 22 runners to 22.18.0 · openclaw/openclaw@4ffa621 models.authStatus: normalize provider ids + tighten env-backed escape… · openclaw/openclaw@f2fdb9d Update CHANGELOG.md · openclaw/openclaw@7694a92 test(parallels): clean up npm update guard jobs · openclaw/openclaw@045ea7b Plugins: prefer scanDir override paths · openclaw/openclaw@b2974da fix(dreaming): default storage.mode to "separate" so phase blocks sto… · openclaw/openclaw@8c392f0 fix(memory-core): skip dreaming transcript ingestion via session stor… · openclaw/openclaw@a1b01f0 fix: dedupe replayed exec.finished node events (#67281) · openclaw/openclaw@5dcf526
test: clear auto-reply media broad matchers · openclaw/openclaw@a096716
steipete · 2026-05-10 · via Recent Commits to openclaw:main

@@ -21,6 +21,58 @@ vi.mock("../../media/read-capability.js", () => ({

21212222

import { createReplyMediaPathNormalizer } from "./reply-media-paths.js";

232324+

type NormalizedReply = {

25+

mediaUrl?: string;

26+

mediaUrls?: string[];

27+

text?: string;

28+

};

29+30+

function isRecord(value: unknown): value is Record<string, unknown> {

31+

return typeof value === "object" && value !== null;

32+

}

33+34+

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

35+

expect(isRecord(value)).toBe(true);

36+

if (!isRecord(value)) {

37+

throw new Error(`${label} was not an object`);

38+

}

39+

return value;

40+

}

41+42+

function expectMedia(result: NormalizedReply, mediaUrl: string, mediaUrls: string[]): void {

43+

expect(result.mediaUrl).toBe(mediaUrl);

44+

expect(result.mediaUrls).toEqual(mediaUrls);

45+

}

46+47+

function expectNoMedia(result: NormalizedReply): void {

48+

expect(result.mediaUrl).toBeUndefined();

49+

expect(result.mediaUrls).toBeUndefined();

50+

}

51+52+

function expectOutboundAttachmentCall(

53+

index: number,

54+

mediaUrl: string,

55+

mediaMaxBytes: number,

56+

): Record<string, unknown> {

57+

const call = resolveOutboundAttachmentFromUrl.mock.calls[index] as unknown[] | undefined;

58+

expect(call).toBeDefined();

59+

if (!call) {

60+

throw new Error(`missing outbound attachment call ${index + 1}`);

61+

}

62+

expect(call[0]).toBe(mediaUrl);

63+

expect(call[1]).toBe(mediaMaxBytes);

64+

return requireRecord(call[2], "outbound attachment options");

65+

}

66+67+

function expectAgentScopedMediaAccessCall(): Record<string, unknown> {

68+

const call = resolveAgentScopedOutboundMediaAccess.mock.calls[0] as unknown[] | undefined;

69+

expect(call).toBeDefined();

70+

if (!call) {

71+

throw new Error("missing agent scoped media access call");

72+

}

73+

return requireRecord(call[0], "agent scoped media access request");

74+

}

75+2476

describe("createReplyMediaPathNormalizer", () => {

2577

beforeEach(() => {

2678

ensureSandboxWorkspaceForSession.mockReset().mockResolvedValue(null);

@@ -48,19 +100,14 @@ describe("createReplyMediaPathNormalizer", () => {

48100

mediaUrls: ["./out/photo.png"],

49101

});

5010251-

expect(result).toMatchObject({

52-

mediaUrl: "/tmp/outbound-media/photo.png",

53-

mediaUrls: ["/tmp/outbound-media/photo.png"],

54-

});

55-

expect(resolveOutboundAttachmentFromUrl).toHaveBeenCalledWith(

103+

expectMedia(result, "/tmp/outbound-media/photo.png", ["/tmp/outbound-media/photo.png"]);

104+

const options = expectOutboundAttachmentCall(

105+

0,

56106

path.join("/tmp/agent-workspace", "out", "photo.png"),

57107

5 * 1024 * 1024,

58-

expect.objectContaining({

59-

mediaAccess: expect.objectContaining({

60-

workspaceDir: "/tmp/agent-workspace",

61-

}),

62-

}),

63108

);

109+

const mediaAccess = requireRecord(options.mediaAccess, "media access");

110+

expect(mediaAccess.workspaceDir).toBe("/tmp/agent-workspace");

64111

});

6511266113

it("maps sandbox-relative media back to the host sandbox workspace before staging", async () => {

@@ -78,21 +125,19 @@ describe("createReplyMediaPathNormalizer", () => {

78125

mediaUrls: ["./out/photo.png", "file:///workspace/screens/final.png"],

79126

});

8012781-

expect(result).toMatchObject({

82-

mediaUrl: "/tmp/outbound-media/photo.png",

83-

mediaUrls: ["/tmp/outbound-media/photo.png", "/tmp/outbound-media/final.png"],

84-

});

85-

expect(resolveOutboundAttachmentFromUrl).toHaveBeenNthCalledWith(

86-

1,

128+

expectMedia(result, "/tmp/outbound-media/photo.png", [

129+

"/tmp/outbound-media/photo.png",

130+

"/tmp/outbound-media/final.png",

131+

]);

132+

expectOutboundAttachmentCall(

133+

0,

87134

path.join("/tmp/sandboxes/session-1", "out", "photo.png"),

88135

5 * 1024 * 1024,

89-

expect.any(Object),

90136

);

91-

expect(resolveOutboundAttachmentFromUrl).toHaveBeenNthCalledWith(

92-

2,

137+

expectOutboundAttachmentCall(

138+

1,

93139

path.join("/tmp/sandboxes/session-1", "screens", "final.png"),

94140

5 * 1024 * 1024,

95-

expect.any(Object),

96141

);

97142

});

98143

@@ -112,15 +157,12 @@ describe("createReplyMediaPathNormalizer", () => {

112157

mediaUrls: ["./out/photo.png"],

113158

});

114159115-

expect(result).toMatchObject({

116-

mediaUrl: undefined,

117-

mediaUrls: undefined,

118-

});

160+

expectNoMedia(result);

119161

expect(resolveOutboundAttachmentFromUrl).toHaveBeenCalledTimes(1);

120-

expect(resolveOutboundAttachmentFromUrl).toHaveBeenCalledWith(

162+

expectOutboundAttachmentCall(

163+

0,

121164

path.join("/tmp/sandboxes/session-1", "out", "photo.png"),

122165

5 * 1024 * 1024,

123-

expect.any(Object),

124166

);

125167

expect(result.text).toBe("⚠️ Media failed.");

126168

});

@@ -136,10 +178,7 @@ describe("createReplyMediaPathNormalizer", () => {

136178

mediaUrls: ["file:///Users/peter/Documents/report.pdf"],

137179

});

138180139-

expect(result).toMatchObject({

140-

mediaUrl: undefined,

141-

mediaUrls: undefined,

142-

});

181+

expectNoMedia(result);

143182

expect(resolveOutboundAttachmentFromUrl).not.toHaveBeenCalled();

144183

});

145184

@@ -158,10 +197,7 @@ describe("createReplyMediaPathNormalizer", () => {

158197

mediaUrls: ["file:///Users/peter/Documents/report.pdf"],

159198

});

160199161-

expect(result).toMatchObject({

162-

mediaUrl: undefined,

163-

mediaUrls: undefined,

164-

});

200+

expectNoMedia(result);

165201

expect(resolveOutboundAttachmentFromUrl).not.toHaveBeenCalled();

166202

});

167203

@@ -180,10 +216,7 @@ describe("createReplyMediaPathNormalizer", () => {

180216

mediaUrls: ["/Users/peter/Documents/report.pdf"],

181217

});

182218183-

expect(result).toMatchObject({

184-

mediaUrl: undefined,

185-

mediaUrls: undefined,

186-

});

219+

expectNoMedia(result);

187220

expect(resolveOutboundAttachmentFromUrl).not.toHaveBeenCalled();

188221

});

189222

@@ -199,15 +232,8 @@ describe("createReplyMediaPathNormalizer", () => {

199232

mediaUrls: [absolutePath],

200233

});

201234202-

expect(result).toMatchObject({

203-

mediaUrl: "/tmp/outbound-media/chart.png",

204-

mediaUrls: ["/tmp/outbound-media/chart.png"],

205-

});

206-

expect(resolveOutboundAttachmentFromUrl).toHaveBeenCalledWith(

207-

absolutePath,

208-

8 * 1024 * 1024,

209-

expect.any(Object),

210-

);

235+

expectMedia(result, "/tmp/outbound-media/chart.png", ["/tmp/outbound-media/chart.png"]);

236+

expectOutboundAttachmentCall(0, absolutePath, 8 * 1024 * 1024);

211237

});

212238213239

it("prefers channel account media limits when staging reply attachments", async () => {

@@ -236,11 +262,7 @@ describe("createReplyMediaPathNormalizer", () => {

236262

mediaUrls: [absolutePath],

237263

});

238264239-

expect(resolveOutboundAttachmentFromUrl).toHaveBeenCalledWith(

240-

absolutePath,

241-

64 * 1024 * 1024,

242-

expect.any(Object),

243-

);

265+

expectOutboundAttachmentCall(0, absolutePath, 64 * 1024 * 1024);

244266

});

245267246268

it("drops workspace-relative media paths that escape the agent workspace", async () => {

@@ -254,10 +276,7 @@ describe("createReplyMediaPathNormalizer", () => {

254276

mediaUrls: ["../../etc/passwd"],

255277

});

256278257-

expect(result).toMatchObject({

258-

mediaUrl: undefined,

259-

mediaUrls: undefined,

260-

});

279+

expectNoMedia(result);

261280

expect(resolveOutboundAttachmentFromUrl).not.toHaveBeenCalled();

262281

});

263282

@@ -276,10 +295,7 @@ describe("createReplyMediaPathNormalizer", () => {

276295

mediaUrls: ["../../etc/passwd"],

277296

});

278297279-

expect(result).toMatchObject({

280-

mediaUrl: undefined,

281-

mediaUrls: undefined,

282-

});

298+

expectNoMedia(result);

283299

expect(resolveOutboundAttachmentFromUrl).not.toHaveBeenCalled();

284300

});

285301

@@ -295,10 +311,9 @@ describe("createReplyMediaPathNormalizer", () => {

295311

mediaUrls: ["/Users/peter/.openclaw/media/tool-image-generation/generated.png"],

296312

});

297313298-

expect(result).toMatchObject({

299-

mediaUrl: "/Users/peter/.openclaw/media/tool-image-generation/generated.png",

300-

mediaUrls: ["/Users/peter/.openclaw/media/tool-image-generation/generated.png"],

301-

});

314+

expectMedia(result, "/Users/peter/.openclaw/media/tool-image-generation/generated.png", [

315+

"/Users/peter/.openclaw/media/tool-image-generation/generated.png",

316+

]);

302317

expect(resolveOutboundAttachmentFromUrl).not.toHaveBeenCalled();

303318

});

304319

@@ -318,10 +333,9 @@ describe("createReplyMediaPathNormalizer", () => {

318333

mediaUrls: ["/Users/peter/.openclaw/media/outbound/generated.png"],

319334

});

320335321-

expect(result).toMatchObject({

322-

mediaUrl: "/Users/peter/.openclaw/media/outbound/generated.png",

323-

mediaUrls: ["/Users/peter/.openclaw/media/outbound/generated.png"],

324-

});

336+

expectMedia(result, "/Users/peter/.openclaw/media/outbound/generated.png", [

337+

"/Users/peter/.openclaw/media/outbound/generated.png",

338+

]);

325339

expect(resolveOutboundAttachmentFromUrl).not.toHaveBeenCalled();

326340

});

327341

@@ -348,10 +362,7 @@ describe("createReplyMediaPathNormalizer", () => {

348362

mediaUrls: [symlinkPath],

349363

});

350364351-

expect(result).toMatchObject({

352-

mediaUrl: undefined,

353-

mediaUrls: undefined,

354-

});

365+

expectNoMedia(result);

355366

expect(resolveOutboundAttachmentFromUrl).not.toHaveBeenCalled();

356367

} finally {

357368

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

@@ -374,10 +385,7 @@ describe("createReplyMediaPathNormalizer", () => {

374385

mediaUrls: ["/Users/peter/secrets/photo.png"],

375386

});

376387377-

expect(result).toMatchObject({

378-

mediaUrl: undefined,

379-

mediaUrls: undefined,

380-

});

388+

expectNoMedia(result);

381389

});

382390383391

it("keeps reply text and appends a warning when all reply media is dropped", async () => {

@@ -393,11 +401,8 @@ describe("createReplyMediaPathNormalizer", () => {

393401

mediaUrls: ["./out/missing.png"],

394402

});

395403396-

expect(result).toMatchObject({

397-

text: "WA_MEDIA_DM_07\n⚠️ Media failed.",

398-

mediaUrl: undefined,

399-

mediaUrls: undefined,

400-

});

404+

expect(result.text).toBe("WA_MEDIA_DM_07\n⚠️ Media failed.");

405+

expectNoMedia(result);

401406

});

402407403408

it("returns a warning-only text reply when media-only output is dropped upstream", async () => {

@@ -412,11 +417,8 @@ describe("createReplyMediaPathNormalizer", () => {

412417

mediaUrls: ["./out/missing.png"],

413418

});

414419415-

expect(result).toMatchObject({

416-

text: "⚠️ Media failed.",

417-

mediaUrl: undefined,

418-

mediaUrls: undefined,

419-

});

420+

expect(result.text).toBe("⚠️ Media failed.");

421+

expectNoMedia(result);

420422

});

421423422424

it("threads requester context into shared outbound media access", async () => {

@@ -439,7 +441,8 @@ describe("createReplyMediaPathNormalizer", () => {

439441

mediaUrls: ["./out/photo.png"],

440442

});

441443442-

expect(resolveAgentScopedOutboundMediaAccess).toHaveBeenCalledWith({

444+

expect(resolveAgentScopedOutboundMediaAccess).toHaveBeenCalledTimes(1);

445+

expect(expectAgentScopedMediaAccessCall()).toEqual({

443446

cfg: {},

444447

agentId: undefined,

445448

workspaceDir: "/tmp/agent-workspace",

@@ -469,9 +472,12 @@ describe("createReplyMediaPathNormalizer", () => {

469472

mediaUrls: [absolutePath],

470473

});

471474472-

expect(resolveAgentScopedOutboundMediaAccess).toHaveBeenCalledWith({

475+

expect(resolveAgentScopedOutboundMediaAccess).toHaveBeenCalledTimes(1);

476+

const accessRequest = expectAgentScopedMediaAccessCall();

477+

expect(typeof accessRequest.agentId).toBe("string");

478+

expect({ ...accessRequest, agentId: undefined }).toEqual({

473479

cfg: { tools: { fs: { workspaceOnly: false } } },

474-

agentId: expect.any(String),

480+

agentId: undefined,

475481

workspaceDir: "/tmp/agent-workspace",

476482

mediaSources: [absolutePath],

477483

sessionKey: "session-key",

@@ -499,13 +505,13 @@ describe("createReplyMediaPathNormalizer", () => {

499505

mediaUrls: [homeRelativePath],

500506

});

501507502-

expect(result).toMatchObject({

503-

mediaUrl: "/tmp/outbound-media/chart.png",

504-

mediaUrls: ["/tmp/outbound-media/chart.png"],

505-

});

506-

expect(resolveAgentScopedOutboundMediaAccess).toHaveBeenCalledWith({

508+

expectMedia(result, "/tmp/outbound-media/chart.png", ["/tmp/outbound-media/chart.png"]);

509+

expect(resolveAgentScopedOutboundMediaAccess).toHaveBeenCalledTimes(1);

510+

const accessRequest = expectAgentScopedMediaAccessCall();

511+

expect(typeof accessRequest.agentId).toBe("string");

512+

expect({ ...accessRequest, agentId: undefined }).toEqual({

507513

cfg: { tools: { fs: { workspaceOnly: false } } },

508-

agentId: expect.any(String),

514+

agentId: undefined,

509515

workspaceDir: "/tmp/agent-workspace",

510516

mediaSources: [homeRelativePath],

511517

sessionKey: "session-key",