Skip to content

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

Closed

Description

@jessevdp

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?

Activity

  1. rekram1-node commented on Sep 3, 2025

    @rekram1-node
    Collaborator

    you may be able to use plugin here

  2. rekram1-node commented on Sep 3, 2025

    @rekram1-node
    Collaborator

    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

  3. jessevdp commented on Sep 3, 2025

    @jessevdp
    ContributorAuthor

    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
          }
        }
      }
    }
  4. rekram1-node commented on Sep 3, 2025

    @rekram1-node
    Collaborator

    @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

  5. jessevdp commented on Sep 3, 2025

    @jessevdp
    ContributorAuthor

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

  6. mfreiwald commented on Sep 4, 2025

    @mfreiwald

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

  7. eisterman commented on Sep 10, 2025

    @eisterman

    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!

  8. fpytloun commented on Oct 3, 2025

    @fpytloun

    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.

  9. rekram1-node commented on Oct 3, 2025

    @rekram1-node
    Collaborator

    @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

  10. fpytloun commented on Oct 3, 2025

    @fpytloun

    @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": {},                                                                                                                  
          }                                                                                                                               
        }                                                                                                                                 
      },
    
  11. rekram1-node commented on Oct 3, 2025

    @rekram1-node
    Collaborator

    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
              }
            }
          }
        }
    
    }
     
    }
    
  12. rekram1-node commented on Oct 3, 2025

    @rekram1-node
    Collaborator

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

  13. mfreiwald commented on Oct 3, 2025

    @mfreiwald

    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.

  14. mfreiwald commented on Oct 3, 2025

    @mfreiwald

    Wait does this already work?

    "models": {
      "gpt-5": {
        "options": {
           "textVerbosity": null
        }
       }
    }
    
  15. rekram1-node commented on Oct 3, 2025

    @rekram1-node
    Collaborator

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

  16. fpytloun commented on Oct 3, 2025

    @fpytloun

    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

  17. thdxr commented on Mar 25, 2026

    @thdxr
    Member

    To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions