From 321e5cc628dadc503790aae833902d922cb1c3e6 Mon Sep 17 00:00:00 2001 From: Bhavesh Patel Date: Tue, 27 Oct 2026 19:18:09 +0530 Subject: [PATCH] fix(sdk-live-test): use /responses path for microsoft-foundry Responses scenarios Co-authored-by: Cursor --- .github/scripts/sdk-live-test/src/scenarios.ts | 13 +++++++++---- .github/scripts/sdk-live-test/test/changed.test.ts | 9 +++++++++ 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/.github/scripts/sdk-live-test/src/scenarios.ts b/.github/scripts/sdk-live-test/src/scenarios.ts index 70c18a07c..00dd523c7 100644 --- a/.github/scripts/sdk-live-test/src/scenarios.ts +++ b/.github/scripts/sdk-live-test/src/scenarios.ts @@ -136,6 +136,11 @@ function mergeParams(model: CatalogueModel): Record { return merged; } +/** The SDK appends the request path to `{openai_endpoint}/openai/v1` for Foundry, so `/v1` would be doubled. */ +function responsesPath(model: CatalogueModel): string { + return model.provider === 'microsoft-foundry' ? '/responses' : '/v1/responses'; +} + /** Cheap output cap; honor removeParams (gpt-4.1* → max_completion_tokens). */ function withCap(model: CatalogueModel, body: Record): Record { const removed = new Set(model.removeParams ?? []); @@ -634,7 +639,7 @@ function planOneMode(model: CatalogueModel, mode: string): Scenario[] { out.push({ id: label('responses/baseline', stream), endpoint: 'createModelResponse', - path: '/v1/responses', + path: responsesPath(model), body: { model: modelId, input: 'Reply with the single word: ok', @@ -653,7 +658,7 @@ function planOneMode(model: CatalogueModel, mode: string): Scenario[] { out.push({ id: label(kind, stream), endpoint: 'createModelResponse', - path: '/v1/responses', + path: responsesPath(model), body: { ...responsesModalityBody(chatFeatureBody(model, feature)), ...(stream ? { stream: true } : {}), @@ -668,7 +673,7 @@ function planOneMode(model: CatalogueModel, mode: string): Scenario[] { out.push({ id: label('responses/params', stream), endpoint: 'createModelResponse', - path: '/v1/responses', + path: responsesPath(model), body: { ...responsesModalityBody( withCap(model, { @@ -683,7 +688,7 @@ function planOneMode(model: CatalogueModel, mode: string): Scenario[] { } } } - pushModalitySmokes(out, model, 'createModelResponse', '/v1/responses', responsesModalityBody); + pushModalitySmokes(out, model, 'createModelResponse', responsesPath(model), responsesModalityBody); return out; case 'embedding': diff --git a/.github/scripts/sdk-live-test/test/changed.test.ts b/.github/scripts/sdk-live-test/test/changed.test.ts index c66153185..60ea30863 100644 --- a/.github/scripts/sdk-live-test/test/changed.test.ts +++ b/.github/scripts/sdk-live-test/test/changed.test.ts @@ -64,6 +64,15 @@ describe('planScenarios', () => { assert.ok(ids.includes('chat/params/stream')); }); + it('foundry responses use /responses, others /v1/responses', () => { + const paths = (provider: string) => + planScenarios({ provider, model: 'gpt', mode: 'responses' }) + .filter((s) => s.id.startsWith('responses/baseline')) + .map((s) => s.path); + assert.deepEqual(paths('microsoft-foundry'), ['/responses', '/responses']); + assert.deepEqual(paths('openai'), ['/v1/responses', '/v1/responses']); + }); + it('caps with max_completion_tokens when max_tokens removed', () => { const body = planScenarios({ provider: 'openai',