Omit textVerbosity option for providers other than Azure (gpt-5) #1577

Open
opened 2026-02-16 17:31:37 -05:00 by yindo · 16 comments
Owner

Originally created by @jessevdp on GitHub (Sep 3, 2025).

Originally assigned to: @rekram1-node on GitHub.

https://github.com/sst/opencode/blob/d6350a7fa61702ac2aa74357e901d59f2c4ee1c7/packages/opencode/src/provider/transform.ts#L94-L97

Azure's OpenAI compatible API does not seem to support that textVerbosity parameter. Currently the only way to disable sending that parameter it is to extend the azure provider. (See the code above.) I'm—however—using a proxy that uses Azure among other hosts (LiteLLM based) and have my provider configured like:

{
  "provider": {
    "my-custom-provider": {
      "name": "My Custom Provider",
      "npm": "@ai-sdk/openai-compatible",
      "options": {
        "baseURL": "https://my-provider.com",
        "apiKey": "...",
        "includeUsage": true
      },
      "models": {
        "gpt-5": {}
      }
    }
  }
}

And see errors like:

AzureException BadRequestError - Unknown parameter: 'textVerbosity'

Any ideas on how we could hint at the config that the backend doesn't support that option?

Originally created by @jessevdp on GitHub (Sep 3, 2025). Originally assigned to: @rekram1-node on GitHub. https://github.com/sst/opencode/blob/d6350a7fa61702ac2aa74357e901d59f2c4ee1c7/packages/opencode/src/provider/transform.ts#L94-L97 Azure's OpenAI compatible API does not seem to support that `textVerbosity` parameter. Currently the only way to disable sending that parameter it is to extend the `azure` provider. (See the code above.) I'm—however—using a proxy that uses Azure among other hosts (LiteLLM based) and have my provider configured like: ```json { "provider": { "my-custom-provider": { "name": "My Custom Provider", "npm": "@ai-sdk/openai-compatible", "options": { "baseURL": "https://my-provider.com", "apiKey": "...", "includeUsage": true }, "models": { "gpt-5": {} } } } } ``` And see errors like: ``` AzureException BadRequestError - Unknown parameter: 'textVerbosity' ``` Any ideas on how we could hint at the config that the backend doesn't support that option?
Author
Owner

@rekram1-node commented on GitHub (Sep 3, 2025):

you may be able to use plugin here

@rekram1-node commented on GitHub (Sep 3, 2025): you may be able to use plugin here
Author
Owner

@rekram1-node commented on GitHub (Sep 3, 2025):

https://github.com/sst/opencode/blob/dev/packages/plugin/src/example.ts

I think you could use this as reference and then just delete textVerbosity from the options record

I havent looked super deep but that may work

@rekram1-node commented on GitHub (Sep 3, 2025): https://github.com/sst/opencode/blob/dev/packages/plugin/src/example.ts I think you could use this as reference and then just delete textVerbosity from the options record I havent looked super deep but that may work
Author
Owner

@jessevdp commented on GitHub (Sep 3, 2025):

Yeah that works! I ended up doing something like:

import type { Plugin } from "@opencode-ai/plugin"

export const RemoveUnsupportedParams: Plugin = async () => {
  return {
    async "chat.params"({ provider, model }, output) {
      if (provider.info.id.includes("my-custom-provider") && model.id.includes("gpt-5")) {
        output.options["textVerbosity"] = undefined
      }
    }
  }
}
@jessevdp commented on GitHub (Sep 3, 2025): Yeah that works! I ended up doing something like: ```ts import type { Plugin } from "@opencode-ai/plugin" export const RemoveUnsupportedParams: Plugin = async () => { return { async "chat.params"({ provider, model }, output) { if (provider.info.id.includes("my-custom-provider") && model.id.includes("gpt-5")) { output.options["textVerbosity"] = undefined } } } } ```
Author
Owner

@rekram1-node commented on GitHub (Sep 3, 2025):

@jessevdp I think given your pretty unique usecase a plugin is suitable solution here and we should be able to close, what do you think

@rekram1-node commented on GitHub (Sep 3, 2025): @jessevdp I think given your pretty unique usecase a plugin is suitable solution here and we should be able to close, what do you think
Author
Owner

@jessevdp commented on GitHub (Sep 3, 2025):

Yeah my situation is probably pretty unique. Hopefully anyone in the same situation is able to find this thread.

@jessevdp commented on GitHub (Sep 3, 2025): Yeah my situation is probably pretty unique. Hopefully anyone in the same situation is able to find this thread.
Author
Owner

@mfreiwald commented on GitHub (Sep 4, 2025):

Thanks for the hint with the plugin.
Just hoping that azure will fix this because everyone with this setup will have the issue..

@mfreiwald commented on GitHub (Sep 4, 2025): Thanks for the hint with the plugin. Just hoping that azure will fix this because everyone with this setup will have the issue..
Author
Owner

@eisterman commented on GitHub (Sep 10, 2025):

There is an identical error when using LiteLLM as proxy for GPT-5, probably for an error from their side. Thank you very much for the plugin idea!

@eisterman commented on GitHub (Sep 10, 2025): There is an identical error when using LiteLLM as proxy for GPT-5, probably for an error from their side. Thank you very much for the plugin idea!
Author
Owner

@fpytloun commented on GitHub (Oct 3, 2025):

Same issue here - when using LiteLLM proxy with GPT-5, I hit this same issue. It should be fixed properly in Opencode rather than hacking custom plugin.

@fpytloun commented on GitHub (Oct 3, 2025): Same issue here - when using LiteLLM proxy with GPT-5, I hit this same issue. It should be fixed properly in Opencode rather than hacking custom plugin.
Author
Owner

@rekram1-node commented on GitHub (Oct 3, 2025):

@fpytloun that sounds fine then we can add an additional exclusion, can you share your opencode.json and I will figure out how we can fix it for everyone...

If the provider isn't deterministic maybe we just have a configuration option that allows you to drop a field

@rekram1-node commented on GitHub (Oct 3, 2025): @fpytloun that sounds fine then we can add an additional exclusion, can you share your opencode.json and I will figure out how we can fix it for everyone... If the provider isn't deterministic maybe we just have a configuration option that allows you to drop a field
Author
Owner

@fpytloun commented on GitHub (Oct 3, 2025):

@rekram1-node here's my config using LiteLLM gateway:

  "provider": {                                                                                                                       
    "litellm": {                                                                                                                      
      "npm": "@ai-sdk/openai-compatible",                                                                                             
      "name": "LiteLLM",                                                                                                              
      "options": {                                                                                                                    
        "baseURL": "https://litellm.domain.tld",                                                                                           
        "apiKey": "{env:LITELLM_OPENAI_API_KEY}"                                                                                          
      },                                                                                                                              
      "models": {                                                                                                                     
        // OpenAI                                                                                                                     
        "gpt-4.1": {},                                                                                                                
        "gpt-4.1-mini": {},                                                                                                           
        "gpt-4o": {},                                                                                                                 
        "gpt-5": {},                                                                                                                  
      }                                                                                                                               
    }                                                                                                                                 
  },
@fpytloun commented on GitHub (Oct 3, 2025): @rekram1-node here's my config using LiteLLM gateway: ``` "provider": { "litellm": { "npm": "@ai-sdk/openai-compatible", "name": "LiteLLM", "options": { "baseURL": "https://litellm.domain.tld", "apiKey": "{env:LITELLM_OPENAI_API_KEY}" }, "models": { // OpenAI "gpt-4.1": {}, "gpt-4.1-mini": {}, "gpt-4o": {}, "gpt-5": {}, } } }, ```
Author
Owner

@rekram1-node commented on GitHub (Oct 3, 2025):

ig we could probably just do an additional exclusion if the provider is "litellm"

if you provider is named something else you could set this:

{
  "provider": {
    "your-provider": {
      "models": {
        "gpt-5": {
          "options": {
            "textVerbosity": null
          }
        }
      }
    }

}
 
}
@rekram1-node commented on GitHub (Oct 3, 2025): ig we could probably just do an additional exclusion if the provider is "litellm" if you provider is named something else you could set this: ``` { "provider": { "your-provider": { "models": { "gpt-5": { "options": { "textVerbosity": null } } } } } }
Author
Owner

@rekram1-node commented on GitHub (Oct 3, 2025):

Idk much about litellm does it always go through that azure endpoint?

@rekram1-node commented on GitHub (Oct 3, 2025): Idk much about litellm does it always go through that azure endpoint?
Author
Owner

@mfreiwald commented on GitHub (Oct 3, 2025):

The problem is that azure doesn't support this parameter.

Checking the provider doesn't make sense in my opinion because LiteLLM provider has a different name in the config.

The model config should have something like "omitParameter" so we are more flexible regarding this.

@mfreiwald commented on GitHub (Oct 3, 2025): The problem is that azure doesn't support this parameter. Checking the provider doesn't make sense in my opinion because LiteLLM provider has a different name in the config. The model config should have something like "omitParameter" so we are more flexible regarding this.
Author
Owner

@mfreiwald commented on GitHub (Oct 3, 2025):

Wait does this already work?

"models": {
  "gpt-5": {
    "options": {
       "textVerbosity": null
    }
   }
}
@mfreiwald commented on GitHub (Oct 3, 2025): Wait does this already work? ``` "models": { "gpt-5": { "options": { "textVerbosity": null } } } ```
Author
Owner

@rekram1-node commented on GitHub (Oct 3, 2025):

@mfreiwald I mean it will definitely set it to null, idk what azure will do if they process it tho

@rekram1-node commented on GitHub (Oct 3, 2025): @mfreiwald I mean it will definitely set it to null, idk what azure will do if they process it tho
Author
Owner

@fpytloun commented on GitHub (Oct 3, 2025):

There is also drop_params parameter in LiteLLM which might simply drop this parameter if unsupported by provider:
https://docs.litellm.ai/docs/completion/drop_params

@fpytloun commented on GitHub (Oct 3, 2025): There is also drop_params parameter in LiteLLM which might simply drop this parameter if unsupported by provider: https://docs.litellm.ai/docs/completion/drop_params
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#1577