diff --git a/packages/opencode/src/provider/transform.ts b/packages/opencode/src/provider/transform.ts index d7be64ca7b..56a35d9af1 100644 --- a/packages/opencode/src/provider/transform.ts +++ b/packages/opencode/src/provider/transform.ts @@ -1134,16 +1134,7 @@ export function options(input: { 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" - // Only inject reasoningSummary for providers that support it natively. - // @ai-sdk/openai-compatible proxies (e.g. LiteLLM) do not understand this - // parameter and return "Unknown parameter: 'reasoningSummary'". - if ( - input.model.api.npm === "@ai-sdk/openai" || - input.model.api.npm === "@ai-sdk/azure" || - input.model.api.npm === "@ai-sdk/github-copilot" - ) { - result["reasoningSummary"] = "auto" - } + result["reasoningSummary"] = "auto" } // Only set textVerbosity for non-chat gpt-5.x models diff --git a/packages/opencode/src/session/llm.ts b/packages/opencode/src/session/llm.ts index 116254a81e..0489e0a2ff 100644 --- a/packages/opencode/src/session/llm.ts +++ b/packages/opencode/src/session/llm.ts @@ -194,23 +194,11 @@ const live: Layer.Layer< const tools = resolveTools(input) - // LiteLLM and some Anthropic proxies require the tools parameter to be present - // when message history contains tool calls, even if no tools are being used. - // Add a dummy tool that is never called to satisfy this validation. - // This is enabled for: - // 1. Providers with "litellm" in their ID or API ID (auto-detected) - // 2. Providers with explicit "litellmProxy: true" option (opt-in for custom gateways) - const isLiteLLMProxy = - item.options?.["litellmProxy"] === true || - input.model.providerID.toLowerCase().includes("litellm") || - input.model.api.id.toLowerCase().includes("litellm") - - // LiteLLM/Bedrock rejects requests where the message history contains tool - // calls but no tools param is present. When there are no active tools (e.g. - // during compaction), inject a stub tool to satisfy the validation requirement. - // The stub description explicitly tells the model not to call it. + // GitHub Copilot may require the tools parameter when message history contains + // tool calls but no tools are active (e.g. compaction). Inject a stub tool that + // is never meant to be invoked. LiteLLM-backed providers are excluded. if ( - (isLiteLLMProxy || input.model.providerID.includes("github-copilot")) && + input.model.providerID.includes("github-copilot") && Object.keys(tools).length === 0 && hasToolCalls(input.messages) ) { @@ -457,7 +445,7 @@ function resolveTools(input: Pick