From e3c21b63a5ed28cd0d87e61e802bbefe17e50483 Mon Sep 17 00:00:00 2001 From: suyx Date: Tue, 4 Aug 2026 18:29:57 +0800 Subject: [PATCH] test(wp7-02): require provider image model mapping --- .../wp7-02-controlled-executor.test.mjs | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tests/package/wp7-02-controlled-executor.test.mjs b/tests/package/wp7-02-controlled-executor.test.mjs index b0959d7..5fe3ea2 100644 --- a/tests/package/wp7-02-controlled-executor.test.mjs +++ b/tests/package/wp7-02-controlled-executor.test.mjs @@ -60,6 +60,18 @@ const stableFlashInteractionModel = { }, }; +const stableFlashOpenAiImageModel = { + config_version: 6, + model_id: "gemini-3.1-flash-image-preview", + route_profile: { + endpoint: "https://oneapi.intelligrow.cn/v1/images/generations", + mode: "sync", + protocol_version: "openai-images-v1", + provider_model_id: "gemini-3.1-flash-image", + reference_endpoint: "https://oneapi.intelligrow.cn/v1/images/edits", + }, +}; + const onePixelPng = Buffer.from( "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk+A8AAQUBAScY42YAAAAASUVORK5CYII=", "base64", @@ -118,6 +130,18 @@ test("TDD-WP7-EXT-001 builds protocol-specific requests without auth in argument assert.equal(interaction.url, "https://oneapi.intelligrow.cn/v1beta/interactions"); assert.equal("authorization" in interaction.headers, false); + const stableOpenAiImage = buildProviderRequest({ + modelConfig: stableFlashOpenAiImageModel, + prompt: "controlled fixture prompt", + ratio: "4:3", + }); + assert.deepEqual(stableOpenAiImage.body, { + model: "gemini-3.1-flash-image", + prompt: "controlled fixture prompt", + response_format: "b64_json", + size: "1408x1056", + }); + const openai = buildProviderRequest({ modelConfig: models[2], prompt: "controlled fixture prompt", ratio: "9:16" }); assert.deepEqual(openai.body, { model: "gpt-image-2",