Repository navigation
fix: bug encountered when using azure gpt-5.5 w/ completions api - #26222
Merged
rekram1-node merged 7 commits intoMay 14, 2026
Merged
Conversation
…deriknsgo/opencode into fix/gpt-5-5-reasoning-effort
Contributor
Author
|
@rekram1-node As discussed on discord, tagging you here |
10 of 13 tasks
Astro-Han
added a commit
to Astro-Han/pawwork
that referenced
this pull request
Jun 3, 2026
Root cause: ProviderTransform.options() adds reasoningEffort:"medium" to any model whose api id contains "gpt-5" (excluding gpt-5-chat/gpt-5-pro). Azure's gpt-5.5 matched that shared block, but Azure's completions API rejects the reasoningEffort parameter, so every request failed and the provider was unusable. Change: add an early-return guard before the shared gpt-5 block — for @ai-sdk/azure models whose api id contains "gpt-5.5", set only reasoningSummary:"auto" and return. Scoped to azure gpt-5.5; all other providers/models keep their existing options. Boundary: only packages/opencode/src/provider/transform.ts (4-line guard) and packages/opencode/test/provider/transform.test.ts (new azure reasoningEffort describe block). No other files touched. Verification: - Red->green: with the guard removed the new test fails (reasoningEffort === "medium"); with it, reasoningEffort is undefined and reasoningSummary === "auto". - Scope-lock tests added per review: azure gpt-5.1 and gpt-5.2 still get reasoningEffort:"medium". - All 10 required CI checks green (typecheck, unit-opencode/app/desktop/ui, e2e-artifacts, smoke-macos-arm64, analyze-js-ts, dependency-review, dev-dep-audit). - Local full opencode suite earlier: 3669 pass / 0 fail; turbo typecheck 8/8. Review follow-ups: - gemini-code-assist (2 threads, resolved): kept the early return (mirrors upstream, currently safe — trailing blocks are provider-specific and never match azure); added the gpt-5.1/5.2 scope tests it suggested. - codex review [P2]: ProviderTransform.variants() still returns reasoningEffort entries for azure gpt-5.5 reasoning variants, and session/llm.ts merges the selected variant after options(). So a user who explicitly selects a reasoning-effort variant for azure gpt-5.5 still hits the Azure rejection. This is pre-existing (not a regression here) and the upstream fix has the same scope. Closing it needs a product decision about whether azure gpt-5.5 should expose reasoning-effort controls plus an out-of-scope change at the merge site — deferred. Residual risk: the variant-selected azure gpt-5.5 path above remains broken (deferred). The non-required windows-advisory check (unit-windows-opencode-server-tools) is red on an unrelated pre-existing #1145 Windows path bug in import.ts (Received "D:\\..." vs expected POSIX path), outside this change's scope; required merge gate is fully green. Ports upstream anomalyco/opencode#26222 (thanks @frederiknsgo).
AIALRA-0
pushed a commit
to AIALRA-0/opencode-turn-engine
that referenced
this pull request
Jun 10, 2026
isaacfinnegan
pushed a commit
to isaacfinnegan/whispercode
that referenced
this pull request
Jun 15, 2026
MarsQiu007
referenced
this pull request
in MarsQiu007/openNovel
Jul 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue for this PR
Closes #26219
Type of change
What does this PR do?
This fixes an issue where gpt-5.5 requests fail when routed through /v1/chat/completions.
ProviderTransform.options() automatically adds reasoningEffort for all models matching gpt-5, which also includes gpt-5.5. Some OpenAI-compatible providers reject this parameter on the chat completions endpoint and return a 400 error.
This PR early returns with only reasoningSummary for the azure package with gpt5.5 so reasoningEffort is no longer added automatically for that model.
How did you verify your code works?
I tested this locally using a patched OpenCode build with gpt-5.5 routed through an OpenAI-compatible /v1/chat/completions endpoint.
Before the change, requests failed with:
Function tools with reasoning_effort are not supported for gpt-5.5 in /v1/chat/completions
After excluding gpt-5.5 from the automatic reasoning block, requests completed successfully.
Screenshots / recordings
If this is a UI change, please include a screenshot or recording.
Checklist
If you do not follow this template your PR will be automatically rejected.