Compare commits

..

1 Commits

Author SHA1 Message Date
Aiden Cline 95136042c7 fix(provider): gate Azure reasoning effort by endpoint 2026-08-03 19:05:48 +00:00
6 changed files with 74 additions and 77 deletions
+27
View File
@@ -252,6 +252,33 @@ These are not strictly enforced, they are just general guidelines:
For net-new functionality, start with a design conversation. Open an issue describing the problem, your proposed approach (optional), and why it belongs in OpenCode. The core team will help decide whether it should move forward; please wait for that approval instead of opening a feature PR directly.
## Trust & Vouch System
This project uses [vouch](https://github.com/mitchellh/vouch) to manage contributor trust. The vouch list is maintained in [`.github/VOUCHED.td`](.github/VOUCHED.td).
### How it works
- **Vouched users** are explicitly trusted contributors.
- **Denounced users** are explicitly blocked. Issues and pull requests from denounced users are automatically closed. If you have been denounced, you can request to be unvouched by reaching out to a maintainer on [Discord](https://opencode.ai/discord)
- **Everyone else** can participate normally — you don't need to be vouched to open issues or PRs.
### For maintainers
Collaborators with write access can manage the vouch list by commenting on any issue:
- `vouch` — vouch for the issue author
- `vouch @username` — vouch for a specific user
- `denounce` — denounce the issue author
- `denounce @username` — denounce a specific user
- `denounce @username <reason>` — denounce with a reason
- `unvouch` / `unvouch @username` — remove someone from the list
Changes are committed automatically to `.github/VOUCHED.td`.
### Denouncement policy
Denouncement is reserved for users who repeatedly submit low-quality AI-generated contributions, spam, or otherwise act in bad faith. It is not used for disagreements or honest mistakes.
## Issue Requirements
All issues **must** use one of our issue templates:
@@ -1307,32 +1307,6 @@ export function options(input: {
return result
}
export function requestOptions(input: {
model: Provider.Model
providerOptions: Record<string, any>
options: Record<string, any>
}) {
if (
input.model.api.npm !== "@ai-sdk/azure" ||
!(input.model.options.useCompletionUrls ?? input.providerOptions.useCompletionUrls)
)
return input.options
const result = { ...input.options }
delete result.reasoningSummary
delete result.include
if (isGpt55OrNewer(input.model.api.id)) delete result.reasoningEffort
return result
}
function isGpt55OrNewer(modelID: string) {
const match = /gpt-(\d)(?:[.-](\d+))?(?:[.-]|$)/i.exec(modelID)
if (!match) return false
const major = Number(match[1])
const minor = Number(match[2] ?? 0)
return major > 5 || (major === 5 && minor >= 5)
}
export function smallOptions(model: Provider.Model) {
const small = Object.values(model.variants ?? {})[0] ?? {}
if (
+9 -5
View File
@@ -88,11 +88,15 @@ export const prepare = Effect.fn("LLMRequestPrep.prepare")(function* (input: Pre
sessionID: input.sessionID,
providerOptions: input.provider.options,
})
const options = ProviderTransform.requestOptions({
model: input.model,
providerOptions: input.provider.options,
options: mergeOptions(mergeOptions(mergeOptions(base, input.model.options), input.agent.options), variant),
})
const options = mergeOptions(mergeOptions(mergeOptions(base, input.model.options), input.agent.options), variant)
if (
input.model.api.npm === "@ai-sdk/azure" &&
(input.provider.options.useCompletionUrls || input.model.options.useCompletionUrls || options.useCompletionUrls)
) {
delete options.reasoningEffort
delete options.reasoningSummary
delete options.include
}
if (isOpenaiOauth) options.instructions = system.join("\n")
const messages =
@@ -264,7 +264,6 @@ describe("ProviderTransform.options - setCacheKey", () => {
})
expect(result.store).toBe(false)
expect(result.reasoningSummary).toBe("auto")
expect(result.reasoningEffort).toBe("medium")
expect(result.promptCacheKey).toBe(sessionID)
})
@@ -526,13 +525,13 @@ describe("ProviderTransform.options - gpt-5 textVerbosity", () => {
expect(result.include).toBeUndefined()
})
test("azure gpt-5.5 chat completions omit unsupported reasoning options after variants merge", async () => {
test("azure chat completions omit unsupported reasoning options after variants merge", async () => {
const model = {
...createGpt5Model("gpt-5.5"),
id: "azure/gpt-5.5",
...createGpt5Model("gpt-5.4"),
id: "azure/gpt-5.4",
providerID: "azure",
api: {
id: "gpt-5.5",
id: "gpt-5.4",
url: "https://azure.com",
npm: "@ai-sdk/azure",
},
@@ -552,7 +551,7 @@ describe("ProviderTransform.options - gpt-5 textVerbosity", () => {
role: "user",
time: { created: Date.now() },
agent: "test",
model: { providerID: "azure", modelID: "gpt-5.5", variant: "high" },
model: { providerID: "azure", modelID: "gpt-5.4", variant: "high" },
} as any,
sessionID,
model,
@@ -694,43 +693,6 @@ describe("ProviderTransform.options - gpt-5 reasoningEffort", () => {
})
})
describe("ProviderTransform.requestOptions - Azure endpoints", () => {
const options = {
reasoningEffort: "high",
reasoningSummary: "auto",
include: ["reasoning.encrypted_content"],
}
test.each([
["preserves Responses reasoning options", "gpt-5.5", {}, {}, options],
[
"preserves reasoning effort for gpt-5.4 Chat Completions",
"gpt-5.4",
{ useCompletionUrls: true },
{},
{ reasoningEffort: "high" },
],
["uses the model endpoint override", "gpt-5.5", { useCompletionUrls: true }, { useCompletionUrls: false }, options],
["omits reasoning effort for gpt-5.5 Chat Completions", "gpt-5.5", { useCompletionUrls: true }, {}, {}],
["omits reasoning effort for gpt-5.6 Chat Completions", "gpt-5.6", { useCompletionUrls: true }, {}, {}],
["omits reasoning effort for gpt-6 Chat Completions", "gpt-6", { useCompletionUrls: true }, {}, {}],
[
"does not treat gpt-50 as a versioned GPT model",
"gpt-50",
{ useCompletionUrls: true },
{},
{ reasoningEffort: "high" },
],
])("%s", (_name, apiID, providerOptions, modelOptions, expected) => {
expect(
ProviderTransform.requestOptions({
model: { api: { id: apiID, npm: "@ai-sdk/azure" }, options: modelOptions } as any,
providerOptions,
options,
}),
).toEqual(expected)
})
})
describe("ProviderTransform.options - gateway", () => {
const sessionID = "test-session-123"
@@ -1,3 +1,8 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M728.039 234C819.325 234 893.323 308.62 893.323 400.668C893.323 492.716 819.325 567.336 728.039 567.336L891.984 732.656C912.81 753.655 898.061 789.56 868.613 789.56H397.472C245.333 789.56 122 665.193 122 511.78C122 358.367 245.333 234 397.472 234H728.039ZM397.472 345.112C306.189 345.112 232.189 419.732 232.189 511.78C232.189 603.828 306.189 678.448 397.472 678.448C488.756 678.448 562.756 603.828 562.756 511.78C562.756 419.732 488.756 345.112 397.472 345.112Z" fill="currentColor" transform="scale(0.0234375)"/>
<path d="M3.10913 12.07C3.65512 12.07 5.76627 11.5988 6.85825 10.98C7.95023 10.3612 7.95023 10.3612 10.207 8.75965C13.0642 6.73196 15.0845 7.41088 18.3968 7.41088" fill="currentColor"/>
<path d="M3.10913 12.07C3.65512 12.07 5.76627 11.5988 6.85825 10.98C7.95023 10.3612 7.95023 10.3612 10.207 8.75965C13.0642 6.73196 15.0845 7.41088 18.3968 7.41088" stroke="currentColor" stroke-width="3.27593"/>
<path d="M21.6 7.43108L16.0037 10.6622V4.20001L21.6 7.43108Z" fill="currentColor" stroke="currentColor" stroke-width="0.0363992"/>
<path d="M3 12.072C3.54599 12.072 5.65714 12.5432 6.74912 13.162C7.8411 13.7808 7.8411 13.7808 10.0978 15.3823C12.9551 17.41 14.9753 16.7311 18.2877 16.7311" fill="currentColor"/>
<path d="M3 12.072C3.54599 12.072 5.65714 12.5432 6.74912 13.162C7.8411 13.7808 7.8411 13.7808 10.0978 15.3823C12.9551 17.41 14.9753 16.7311 18.2877 16.7311" stroke="currentColor" stroke-width="3.27593"/>
<path d="M21.4909 16.7109L15.8945 13.4798V19.942L21.4909 16.7109Z" fill="currentColor" stroke="currentColor" stroke-width="0.0363992"/>
</svg>

Before

Width:  |  Height:  |  Size: 627 B

After

Width:  |  Height:  |  Size: 1.1 KiB

@@ -366,9 +366,34 @@
</symbol>
<symbol viewBox="0 0 24 24" fill="none" id="openrouter">
<path
d="M728.039 234C819.325 234 893.323 308.62 893.323 400.668C893.323 492.716 819.325 567.336 728.039 567.336L891.984 732.656C912.81 753.655 898.061 789.56 868.613 789.56H397.472C245.333 789.56 122 665.193 122 511.78C122 358.367 245.333 234 397.472 234H728.039ZM397.472 345.112C306.189 345.112 232.189 419.732 232.189 511.78C232.189 603.828 306.189 678.448 397.472 678.448C488.756 678.448 562.756 603.828 562.756 511.78C562.756 419.732 488.756 345.112 397.472 345.112Z"
d="M3.10913 12.07C3.65512 12.07 5.76627 11.5988 6.85825 10.98C7.95023 10.3612 7.95023 10.3612 10.207 8.75965C13.0642 6.73196 15.0845 7.41088 18.3968 7.41088"
fill="currentColor"
transform="scale(0.0234375)"
></path>
<path
d="M3.10913 12.07C3.65512 12.07 5.76627 11.5988 6.85825 10.98C7.95023 10.3612 7.95023 10.3612 10.207 8.75965C13.0642 6.73196 15.0845 7.41088 18.3968 7.41088"
stroke="currentColor"
stroke-width="3.27593"
></path>
<path
d="M21.6 7.43108L16.0037 10.6622V4.20001L21.6 7.43108Z"
fill="currentColor"
stroke="currentColor"
stroke-width="0.0363992"
></path>
<path
d="M3 12.072C3.54599 12.072 5.65714 12.5432 6.74912 13.162C7.8411 13.7808 7.8411 13.7808 10.0978 15.3823C12.9551 17.41 14.9753 16.7311 18.2877 16.7311"
fill="currentColor"
></path>
<path
d="M3 12.072C3.54599 12.072 5.65714 12.5432 6.74912 13.162C7.8411 13.7808 7.8411 13.7808 10.0978 15.3823C12.9551 17.41 14.9753 16.7311 18.2877 16.7311"
stroke="currentColor"
stroke-width="3.27593"
></path>
<path
d="M21.4909 16.7109L15.8945 13.4798V19.942L21.4909 16.7109Z"
fill="currentColor"
stroke="currentColor"
stroke-width="0.0363992"
></path>
</symbol>
<symbol viewBox="0 0 24 24" fill="none" id="opencode">

Before

Width:  |  Height:  |  Size: 275 KiB

After

Width:  |  Height:  |  Size: 276 KiB