crush icon indicating copy to clipboard operation
crush copied to clipboard

Provider-specific options (provider_options) are silently ignored

Open novalis78 opened this issue 1 month ago • 0 comments

Description

Description

Provider-specific options configured in crush.json via the provider_options field are completely ignored. This affects all providers and prevents users from configuring provider-specific features like reasoning parameters, usage tracking, custom headers, etc.

Environment

  • Affected Component: internal/config/load.go (lines 183-196)
  • Impact: All providers
  • Severity: High - user configuration is silently ignored

Reproduction Steps

  1. Add provider_options to a provider in crush.json:
{
  "providers": {
    "openrouter": {
      "provider_options": {
        "reasoning": {
          "max_tokens": 2000
        },
        "include_usage": false
      }
    }
  }
}
  1. Use Crush with this configuration
  2. Observe that provider options are not applied to requests

Root Cause

In internal/config/load.go at lines 183-196, the configureProviders function creates a ProviderConfig struct but fails to copy the ProviderOptions field:

prepared := ProviderConfig{
    ID:                 string(p.ID),
    Name:               p.Name,
    BaseURL:            p.APIEndpoint,
    APIKey:             p.APIKey,
    Type:               p.Type,
    Disable:            config.Disable,
    SystemPromptPrefix: config.SystemPromptPrefix,
    ExtraHeaders:       headers,
    ExtraBody:          config.ExtraBody,
    // ProviderOptions:    config.ProviderOptions,  // <-- MISSING!
    ExtraParams:        make(map[string]string),
    Models:             p.Models,
}

Expected Behavior

Provider-specific options should be merged from user configuration and applied to provider requests.

Impact Examples

  • OpenRouter: Cannot configure reasoning parameters for models like Gemini 3
  • All providers: Cannot disable usage tracking with include_usage: false
  • Custom providers: Cannot pass provider-specific configuration options

Fix

Add one line to copy the ProviderOptions field:

ProviderOptions:    config.ProviderOptions,

This ensures provider-specific options from crush.json are properly merged into the final provider configuration.

Version

0.18.2

Environment

all platforms

novalis78 avatar Nov 18 '25 23:11 novalis78