@@ -528,6 +528,42 @@ describe("tryDispatchAcpReply", () => {
|
528 | 528 | expect(mediaUnderstandingMocks.applyMediaUnderstanding).not.toHaveBeenCalled(); |
529 | 529 | }); |
530 | 530 | |
| 531 | +it("passes the ACP agent directory to media understanding", async () => { |
| 532 | +setReadyAcpResolution(); |
| 533 | +mockVisibleTextTurn("image turn"); |
| 534 | +const tempDir = await fs.mkdtemp(path.join(os.tmpdir(), "dispatch-acp-")); |
| 535 | +const agentDir = path.join(tempDir, "codex-agent"); |
| 536 | +const imagePath = path.join(tempDir, "inbound.png"); |
| 537 | +try { |
| 538 | +await fs.mkdir(agentDir); |
| 539 | +await fs.writeFile(imagePath, "image-bytes"); |
| 540 | + |
| 541 | +await runDispatch({ |
| 542 | +bodyForAgent: "describe image", |
| 543 | +cfg: createAcpTestConfig({ |
| 544 | +agents: { |
| 545 | +list: [{ id: "codex-acp", agentDir }], |
| 546 | +}, |
| 547 | +channels: { |
| 548 | +discord: { |
| 549 | +attachmentRoots: [tempDir], |
| 550 | +}, |
| 551 | +}, |
| 552 | +}), |
| 553 | +ctxOverrides: { |
| 554 | +MediaPath: imagePath, |
| 555 | +MediaType: "image/png", |
| 556 | +}, |
| 557 | +}); |
| 558 | + |
| 559 | +expect(mediaUnderstandingMocks.applyMediaUnderstanding).toHaveBeenCalledWith( |
| 560 | +expect.objectContaining({ agentDir }), |
| 561 | +); |
| 562 | +} finally { |
| 563 | +await fs.rm(tempDir, { recursive: true, force: true }); |
| 564 | +} |
| 565 | +}); |
| 566 | + |
531 | 567 | it("forwards normalized image attachments into ACP turns", async () => { |
532 | 568 | const tempDir = await fs.mkdtemp(path.join(os.tmpdir(), "dispatch-acp-")); |
533 | 569 | const imagePath = path.join(tempDir, "inbound.png"); |
|