refactor(responses): remove chat_completions and wire responses features end-to-end

This commit is contained in:
lpf
2026-03-04 10:25:50 +08:00
parent d42b6a6f10
commit 6c78ef3b1c
14 changed files with 726 additions and 486 deletions

View File

@@ -208,8 +208,8 @@ func Validate(cfg *Config) []error {
if active == "" {
active = "proxy"
}
if pc, ok := providerConfigByName(cfg, active); !ok || !pc.SupportsResponsesCompact || pc.Protocol != "responses" {
errs = append(errs, fmt.Errorf("context_compaction.mode=responses_compact requires active proxy %q with protocol=responses and supports_responses_compact=true", active))
if pc, ok := providerConfigByName(cfg, active); !ok || !pc.SupportsResponsesCompact {
errs = append(errs, fmt.Errorf("context_compaction.mode=responses_compact requires active proxy %q with supports_responses_compact=true", active))
}
}
@@ -314,16 +314,6 @@ func validateProviderConfig(path string, p ProviderConfig) []error {
if p.APIBase == "" {
errs = append(errs, fmt.Errorf("%s.api_base is required", path))
}
if p.Protocol != "" {
switch p.Protocol {
case "chat_completions", "responses":
default:
errs = append(errs, fmt.Errorf("%s.protocol must be one of: chat_completions, responses", path))
}
}
if p.SupportsResponsesCompact && p.Protocol != "responses" {
errs = append(errs, fmt.Errorf("%s.supports_responses_compact=true requires protocol=responses", path))
}
if p.TimeoutSec <= 0 {
errs = append(errs, fmt.Errorf("%s.timeout_sec must be > 0", path))
}