mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-07-26 09:52:11 +03:00
A custom OpenAI-compatible image-edit provider received an empty `model`. In production `globalThis.fetch` is patched with node_modules/undici's fetch, whose `FormData` class differs from `globalThis.FormData`; passing a native FormData made undici serialize it as the string "[object FormData]" (text/plain), dropping every field including `model`. handleOpenAIImageEdit now assembles the multipart body as a Buffer with an explicit boundary + Content-Type, which every fetch impl accepts verbatim. Regression test: tests/unit/image-edits-multipart-3273.test.ts reproduces the exact prod condition (routes through undici's fetch) — RED before (upstream got text/plain [object FormData]), GREEN after. Existing image suites stay green (50/50).