[PR #3497] Allow passing custom provider options to opencode run #10673

Closed
opened 2026-02-16 18:15:24 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/3497

State: closed
Merged: No


The goal of this PR is to provide users of opencode run the flexibility to set and use every possible provider option proposed by the AI SDK.

This is a compromise with https://github.com/sst/opencode/pull/3475, in which I proposed a dedicated argument for an openai-specific property.

This new approach is more technical (users need to check with Vercel docs for what is available), but has the large advantage to deport the maintenance from opencode devs to vercel devs:

  • new models will be customizable without having to their properties to the code
  • no headache to find how to generalize a property (like reasoning effort) to all models
  • no arbitrary choice to make (mapping of reasoning effort from gemini's numbers to openai's enum)

Of course, dedicated arguments for important parameters will always be welcome, but at least now there will always be a workaround for missing arguments.

Does it work?

The best way to check that is to pass an invalid value and see if Vercel's AI SDK shows the correct error.
Here I tested it with reasoningEffort for openai models.

image image

Note

Aiden, of course this is a proposal, feel free to discard it if that's not the way Opencode wants to go.

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/3497 **State:** closed **Merged:** No --- The goal of this PR is to provide users of `opencode run` the flexibility to set and use every possible provider option proposed by the AI SDK. This is a compromise with https://github.com/sst/opencode/pull/3475, in which I proposed a dedicated argument for an openai-specific property. This new approach is more technical (users need to check with Vercel docs for what is available), but has the large advantage to deport the maintenance from opencode devs to vercel devs: - new models will be customizable without having to their properties to the code - no headache to find how to generalize a property (like reasoning effort) to all models - no arbitrary choice to make (mapping of reasoning effort from gemini's numbers to openai's enum) Of course, dedicated arguments for important parameters will always be welcome, but at least now there will always be a workaround for missing arguments. ## Does it work? The best way to check that is to pass an invalid value and see if Vercel's AI SDK shows the correct error. Here I tested it with `reasoningEffort` for openai models. <img width="1225" height="123" alt="image" src="https://github.com/user-attachments/assets/e598c6f4-5c4b-4a76-8420-ae8cbbf120f0" /> <img width="1229" height="117" alt="image" src="https://github.com/user-attachments/assets/8f5cbbd7-2ffe-4f13-953a-fad4b02ac9d2" /> ## Note Aiden, of course this is a proposal, feel free to discard it if that's not the way Opencode wants to go.
yindo added the pull-request label 2026-02-16 18:15:24 -05:00
yindo closed this issue 2026-02-16 18:15:24 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#10673