Skip to content

Commit e6ccfa1

Browse files
hartmarkclaude
andcommitted
fix(ai): correct stale instructions-field defaults in Azure test and doc
The Azure narrowing in 9bbac5e (usesVerifiedInstructionsEndpoint -> openai-public | openai | xai-native) correctly moved Azure back to embedding the prompt in input, but left one test assertion and two comments describing the pre-narrowing universal default. Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Vk2cBRQdErwRtPea8VuhG6
1 parent 9bbac5e commit e6ccfa1

2 files changed

Lines changed: 12 additions & 5 deletions

File tree

‎packages/ai/src/transports/openai-responses-prompt-observer.test.ts‎

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -280,9 +280,12 @@ afterEach(() => {
280280
});
281281

282282
describe("OpenAI Responses provider prompt observer", () => {
283-
// Every non-Codex Responses request now carries the system prompt via
284-
// `instructions`, not an `input.developer`/`input.system` message -- see
285-
// resolveOpenAIResponsesInstructions in openai-responses-params-internal.ts.
283+
// createModel() defaults to a verified native OpenAI route (see
284+
// usesVerifiedInstructionsEndpoint in openai-responses-payload-policy.ts),
285+
// so this request carries the system prompt via top-level `instructions`
286+
// rather than an `input.developer`/`input.system` message. That default is
287+
// route-specific, not universal -- see the Azure test below, which is on
288+
// an unverified route and falls back to input.developer.
286289
// The reasoning flag no longer changes promptSource (it used to select
287290
// between the developer/system input roles); both cases stay in the table
288291
// to confirm reasoning=true/false doesn't regress instructions delivery.
@@ -326,7 +329,11 @@ describe("OpenAI Responses provider prompt observer", () => {
326329
expect(run.observations[0]).toMatchObject({
327330
egress: "responses-sdk",
328331
payloadVariant: "initial",
329-
promptSource: "instructions",
332+
// Azure is not a verified instructions-field route (see
333+
// usesVerifiedInstructionsEndpoint in openai-responses-payload-policy.ts)
334+
// -- it falls back to embedding the prompt in input, same as any other
335+
// unverified route.
336+
promptSource: "input.developer",
330337
matchesAssembledPrompt: true,
331338
});
332339
});

‎packages/llm-core/src/types.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ export interface OpenAIResponsesCompat {
532532
sendSessionIdHeader?: boolean;
533533
/** Whether the provider supports `prompt_cache_retention: "24h"`. Default: true. */
534534
supportsLongCacheRetention?: boolean;
535-
/** Whether the provider honors top-level `instructions`. Default: true; set false for proxies that silently ignore it, which falls back to embedding the system prompt in `input`. */
535+
/** Whether the provider honors top-level `instructions`. Defaults to true only for verified native routes (OpenAI, xAI); every other route defaults to false and embeds the system prompt in `input` unless set true here after verifying against that endpoint. */
536536
supportsInstructions?: boolean;
537537
}
538538

0 commit comments

Comments
 (0)