From 05f0a4b175dfabdb228917feb3db1c6a139899f7 Mon Sep 17 00:00:00 2001 From: Devraj Mehta Date: Fri, 11 Sep 2026 21:12:19 +0000 Subject: [PATCH 1/2] Fix replay model image capacity Advertise room for the two image-bearing messages in replay fixtures and verify the HTTP models response for missing, empty, and cached model catalogs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 7e3dcf84-04c4-4bb7-8a42-7ca5904f3cf7 --- test/harness/replayingCapiProxy.test.ts | 14 ++++++++++++++ test/harness/replayingCapiProxy.ts | 6 +++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/test/harness/replayingCapiProxy.test.ts b/test/harness/replayingCapiProxy.test.ts index 062fe89ae9..dff3de24d5 100644 --- a/test/harness/replayingCapiProxy.test.ts +++ b/test/harness/replayingCapiProxy.test.ts @@ -1661,6 +1661,12 @@ Always include PINEAPPLE_COCONUT_42. data: Array<{ id: string }>; }; expect(parsed.data.map((model) => model.id)).toEqual(["claude-sonnet-5"]); + expect(parsed.data[0]).toMatchObject({ + capabilities: { + supports: { vision: true }, + limits: { vision: { max_prompt_images: 2 } }, + }, + }); } finally { await proxy.stop(); } @@ -1694,6 +1700,14 @@ Always include PINEAPPLE_COCONUT_42. expect(parsed.data).toHaveLength(2); expect(parsed.data[0].id).toBe("gpt-4o"); expect(parsed.data[1].id).toBe("claude-sonnet-4"); + for (const model of parsed.data) { + expect(model).toMatchObject({ + capabilities: { + supports: { vision: true }, + limits: { vision: { max_prompt_images: 2 } }, + }, + }); + } } finally { await proxy.stop(); } diff --git a/test/harness/replayingCapiProxy.ts b/test/harness/replayingCapiProxy.ts index 9bcafcdad4..66a501e03d 100644 --- a/test/harness/replayingCapiProxy.ts +++ b/test/harness/replayingCapiProxy.ts @@ -2018,7 +2018,11 @@ function createGetModelsResponse(modelIds: string[]) { name: id, capabilities: { supports: { vision: true }, - limits: { max_context_window_tokens: 128000 }, + limits: { + max_context_window_tokens: 128000, + // Replay fixtures contain two image-bearing messages. + vision: { max_prompt_images: 2 }, + }, }, })), }; From f28132b956816e8b8d26f6f83a97d9e2215f52b0 Mon Sep 17 00:00:00 2001 From: Devraj Mehta Date: Fri, 11 Sep 2026 21:50:58 +0000 Subject: [PATCH 2/2] Fix required vision fields in replay model metadata Return complete vision limits compatible with generated SDK model parsers. Validate the HTTP catalog fields and check the fixture against the shared SDK vision type. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 7e3dcf84-04c4-4bb7-8a42-7ca5904f3cf7 --- test/harness/replayingCapiProxy.test.ts | 22 ++++++++++++++++++++-- test/harness/replayingCapiProxy.ts | 7 ++++++- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/test/harness/replayingCapiProxy.test.ts b/test/harness/replayingCapiProxy.test.ts index dff3de24d5..2eb022ac13 100644 --- a/test/harness/replayingCapiProxy.test.ts +++ b/test/harness/replayingCapiProxy.test.ts @@ -1664,7 +1664,16 @@ Always include PINEAPPLE_COCONUT_42. expect(parsed.data[0]).toMatchObject({ capabilities: { supports: { vision: true }, - limits: { vision: { max_prompt_images: 2 } }, + limits: { + vision: { + max_prompt_images: 2, + max_prompt_image_size: expect.any(Number), + supported_media_types: expect.arrayContaining([ + "image/png", + "image/jpeg", + ]), + }, + }, }, }); } finally { @@ -1704,7 +1713,16 @@ Always include PINEAPPLE_COCONUT_42. expect(model).toMatchObject({ capabilities: { supports: { vision: true }, - limits: { vision: { max_prompt_images: 2 } }, + limits: { + vision: { + max_prompt_images: 2, + max_prompt_image_size: expect.any(Number), + supported_media_types: expect.arrayContaining([ + "image/png", + "image/jpeg", + ]), + }, + }, }, }); } diff --git a/test/harness/replayingCapiProxy.ts b/test/harness/replayingCapiProxy.ts index 66a501e03d..ef4fadb9d4 100644 --- a/test/harness/replayingCapiProxy.ts +++ b/test/harness/replayingCapiProxy.ts @@ -14,6 +14,7 @@ import type { import { ChatCompletionStream } from "openai/resources/chat/completions"; import path from "path"; import yaml from "yaml"; +import type { ModelCapabilitiesLimitsVision } from "../../nodejs/src/generated/rpc"; import { CapturedExchange, CapturingHttpProxy, @@ -2021,7 +2022,11 @@ function createGetModelsResponse(modelIds: string[]) { limits: { max_context_window_tokens: 128000, // Replay fixtures contain two image-bearing messages. - vision: { max_prompt_images: 2 }, + vision: { + max_prompt_images: 2, + max_prompt_image_size: 20 * 1024 * 1024, + supported_media_types: ["image/png", "image/jpeg"], + } satisfies ModelCapabilitiesLimitsVision, }, }, })),