Skip to content

Commit 3f0ccf7

Browse files
fix(provider): guard reasoningSummary for openai-compatible providers
@ai-sdk/openai-compatible proxies such as LiteLLM do not support the reasoningSummary parameter and return an error when it is present: Unknown parameter: 'reasoningSummary' The variants() function already correctly scopes reasoningSummary to @ai-sdk/openai, @ai-sdk/azure, and @ai-sdk/github-copilot. Apply the same guard in options() to be consistent. Fixes anomalyco#22350, anomalyco#21237, anomalyco#18882
1 parent 67aaeca commit 3f0ccf7

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

‎packages/opencode/src/provider/transform.ts‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -832,7 +832,16 @@ export namespace ProviderTransform {
832832
if (input.model.api.id.includes("gpt-5") && !input.model.api.id.includes("gpt-5-chat")) {
833833
if (!input.model.api.id.includes("gpt-5-pro")) {
834834
result["reasoningEffort"] = "medium"
835-
result["reasoningSummary"] = "auto"
835+
// Only inject reasoningSummary for providers that support it natively.
836+
// @ai-sdk/openai-compatible proxies (e.g. LiteLLM) do not understand this
837+
// parameter and return "Unknown parameter: 'reasoningSummary'".
838+
if (
839+
input.model.api.npm === "@ai-sdk/openai" ||
840+
input.model.api.npm === "@ai-sdk/azure" ||
841+
input.model.api.npm === "@ai-sdk/github-copilot"
842+
) {
843+
result["reasoningSummary"] = "auto"
844+
}
836845
}
837846

838847
// Only set textVerbosity for non-chat gpt-5.x models

0 commit comments

Comments
 (0)