Skip to content

[Bug] reasoningSummary injected for Azure/openai-compatible providers — should be guarded like textVerbosity #21237

Closed

Description

@Dulani

[Authorship: 80% AI, 20% human]

Description

In transform.ts, reasoningSummary = "auto" is set for all gpt-5 models (line ~829) with no Azure guard. The textVerbosity parameter has an Azure guard (input.model.providerID !== "azure" on line ~838), but reasoningSummary does not.

Impact

Azure OpenAI rejects reasoningSummary as an unknown parameter. This is currently masked when using useResponses: true (which routes through the copilot Responses SDK), but will break if that path changes.

Evidence

// transform.ts ~line 826
if (input.model.api.id.includes("gpt-5") && !input.model.api.id.includes("gpt-5-chat")) {
  if (!input.model.api.id.includes("gpt-5-pro")) {
    result["reasoningEffort"] = "medium"
    result["reasoningSummary"] = "auto"   // ← NO Azure guard here
  }
  if (
    input.model.api.id.includes("gpt-5.") &&
    !input.model.api.id.includes("codex") &&
    !input.model.api.id.includes("-chat") &&
    input.model.providerID !== "azure"    // ← textVerbosity IS guarded
  ) {
    result["textVerbosity"] = "low"
  }
}

Proposed Fix

Add && input.model.providerID !== "azure" to the reasoningSummary block (lines 827-830), or use input.model.api.npm !== "@ai-sdk/openai-compatible" to match existing patterns elsewhere in the codebase.

Related

Activity

  1. github-actions commented on Apr 6, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    Both of those issues were resolved. If the problem has regressed or your scenario is meaningfully different (e.g., specific to Azure rather than generic openai-compatible providers), please describe how your case differs from those.

  2. daitmaamar4-png commented on Apr 7, 2026

    @daitmaamar4-png

    Confirmed: This is the same root cause affecting @ai-sdk/openai providers with LiteLLM proxies (like our issue #21346). The
    easoningSummary = 'auto' injection without provider guards breaks any non-OpenAI endpoint that doesn't recognize this parameter, causing response parsing crashes. The fix should extend the existing Azure guard pattern to cover custom providers via input.model.api.npm !== '@ai-sdk/openai' or similar checks. Applying the same guard used for extVerbosity to the
    easoningSummary block should resolve both scenarios.

  3. Dulani commented on Apr 8, 2026

    @Dulani
    Author

    Thanks for the links. Those issues (#13546, #16154) addressed reasoningSummary being sent to unsupported providers generally. This issue is different: it's a code-level asymmetry in transform.ts — textVerbosity has && input.model.providerID !== "azure" on line ~838 but reasoningSummary in the same block (lines 827–830) does not. The bug is the inconsistent guard, not the general injection problem those PRs fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions