Uh oh!
There was an error while loading. Please reload this page.
fix(provider): avoid incompatible GPT-5 defaults and sanitize Gemini tool schemas - #18915
Conversation
cd702f5 to
b9d0041CompareThanks for updating your PR! It now meets our contributing guidelines. 👍 |
rekram1-node
commented
May 15, 2026
Automated PR Cleanup Thank you for contributing to opencode. Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions. This PR was closed because it matched the following cleanup criteria:
PRs created within the last month are not affected by this cleanup. If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate. Thanks again for taking the time to contribute. |
Issue for this PR
Closes#18882
Type of change
What does this PR do?
This fixes two compatibility problems from #18882.
ProviderTransform.options()was applying GPT-5 default request fields too broadly based on the model ID. That caused generic@ai-sdk/openai-compatibleproviders or proxies using models likegpt-5.4to receive fields such asreasoningSummary,reasoningEffort,textVerbosity, andinclude, even when the backend did not support them. This change limits those defaults to transports/providers that explicitly support them.This PR also tightens Gemini tool schema sanitization. The Gemini schema path now inlines local refs and recursively removes unsupported keys such as
$schema,additionalProperties,$ref,ref,$defs, anddefinitions. Structured output now reuses the same sanitization path so it does not bypass the Gemini-specific cleanup.How did you verify your code works?
I added regression tests covering:
@ai-sdk/openai-compatiblegpt-5.4models no longer receiving OpenAI-only defaultsopencode*GPT-5 providers still keeping supported defaultsI also ran:
git diff --checkcd packages/opencode && bun run typecheckbunx turbo typecheckScreenshots / recordings
Not a UI change.
Checklist
If you do not follow this template your PR will be automatically rejected.