diff --git a/pkg/providers/factory_provider.go b/pkg/providers/factory_provider.go index 962e6ae19..ebb76f05d 100644 --- a/pkg/providers/factory_provider.go +++ b/pkg/providers/factory_provider.go @@ -91,6 +91,10 @@ func CreateProviderFromConfig(cfg *config.ModelConfig) (LLMProvider, string, err if apiBase == "" { apiBase = getDefaultAPIBase(protocol) } + // OpenAI is the protocol where /responses is expected to work natively. + // The shared openai_compat transport still keeps /chat/completions as the + // compatibility path, but gpt-5-family models will probe /responses + // first before falling back when necessary. return NewHTTPProviderWithMaxTokensFieldAndRequestTimeout( cfg.APIKey(), apiBase, @@ -159,7 +163,12 @@ func CreateProviderFromConfig(cfg *config.ModelConfig) (LLMProvider, string, err "vivgrid", "volcengine", "vllm", "qwen", "qwen-intl", "qwen-international", "dashscope-intl", "qwen-us", "dashscope-us", "mistral", "avian", "longcat", "modelscope", "novita", "coding-plan", "alibaba-coding", "qwen-coding", "mimo": - // All other OpenAI-compatible HTTP providers + // All other OpenAI-compatible HTTP providers. + // These providers generally remain /chat/completions-first in practice, + // even though they share the same transport/parser wrapper. If one of + // these gateways exposes a gpt-5-family model ID, openai_compat may probe + // /responses once and then fall back automatically when the endpoint does + // not support it. if cfg.APIKey() == "" && cfg.APIBase == "" { return nil, "", fmt.Errorf("api_key or api_base is required for HTTP-based protocol %q", protocol) } diff --git a/pkg/providers/openai_compat/provider.go b/pkg/providers/openai_compat/provider.go index 295322e95..0268c9f64 100644 --- a/pkg/providers/openai_compat/provider.go +++ b/pkg/providers/openai_compat/provider.go @@ -172,8 +172,11 @@ func shouldPreferResponses(rawModel, normalizedModel string) bool { normalizedModel = strings.ToLower(strings.TrimSpace(normalizedModel)) // Keep the automatic route conservative: only gpt-5 models are forced - // onto /responses, and all other model families stay on chat/completions - // unless they are explicitly routed elsewhere by the caller. + // onto /responses today, and all other model families stay on + // /chat/completions unless they are explicitly routed elsewhere by the + // caller. When OpenAI ships another Responses-first family (for example, + // gpt-6), update this gate at the same time so new native models do not + // silently stay on the compatibility path. return strings.HasPrefix(rawModel, "gpt-5") || strings.HasPrefix(normalizedModel, "gpt-5") }