fix(gemini): route Gemini through OpenAI-compatible endpoint for OpenShell - #2440
Merged
Merged
Conversation
OpenShell only supports protocol-family provider types (openai, anthropic, ...); it has no dedicated "gemini" type, so workspace creation failed with "unsupported provider type or profile: gemini". Google publishes an OpenAI-compatible endpoint that accepts a plain Bearer API key, so the Gemini connection is now registered with OpenShell as an "openai" provider pointed at that endpoint, mirroring the pattern used by openai-compatible. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Signed-off-by: Brian Mahabir <56164556+bmahabirbu@users.noreply.github.com>
The Gemini connection was missing an endpoint, so the OpenCode agent
generated a model string (gemini/...) with no provider config block —
OpenCode could not reach the model. Add the Google OpenAI-compat
endpoint to the connection so a custom provider entry is written.
Also inject a default apiKey option ({env:OPENAI_API_KEY}) for custom
providers in the OpenCode extension so @ai-sdk/openai-compatible can
authenticate via the env var that OpenShell injects.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Brian <bmahabir@bu.edu>
bmahabirbu
requested review from
MarsKubeX and
fbricon
and removed request for
a team
July 13, 2026 06:39
Contributor
📝 WalkthroughWalkthroughGemini now registers through an OpenAI-compatible endpoint and stores connection data under ChangesOpenAI-compatible connection integration
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This was referenced Jul 21, 2026
TypeError: sdk.responses is not a function when using OpenAI Compatible provider with OpenCode
#2519
Closed
5 tasks
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.
Summary
openaiprovider type since OpenShell has no nativegeminiprovider, using Google's OpenAI-compatible endpoint (generativelanguage.googleapis.com/v1beta/openai/)endpointto the Gemini connection so the OpenCode agent generates a proper custom provider config block with@ai-sdk/openai-compatibleapiKey: '{env:OPENAI_API_KEY}'in OpenCode's custom provider options so the SDK can authenticate via the env var OpenShell injectsScreencast.From.2026-07-13.02-40-34.mp4
Fixes: #2429
Test:
Add ur api key to the gemini extension so its saved in kaiden
select the opencode provider with gemini and create a sandbox see if u can interact with it