mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-02-03 04:50:52 +08:00
refactor(executor): remove ClientAdapter and legacy fallback logic
- Deleted `ClientAdapter` implementation and associated fallback methods. - Removed legacy executor logic from `codex`, `claude`, `gemini`, and `qwen` executors. - Simplified `handlers` by eliminating `UnwrapError` handling and related dependencies. - Cleaned up `model_registry` by removing logic associated with suspended clients. - Updated `.gitignore` to ignore `.serena/` directory.
This commit is contained in:
@@ -393,23 +393,24 @@ func (r *ModelRegistry) GetModelProviders(modelID string) []string {
|
||||
count int
|
||||
}
|
||||
providers := make([]providerCount, 0, len(registration.Providers))
|
||||
suspendedByProvider := make(map[string]int)
|
||||
if registration.SuspendedClients != nil {
|
||||
for clientID := range registration.SuspendedClients {
|
||||
if provider, ok := r.clientProviders[clientID]; ok && provider != "" {
|
||||
suspendedByProvider[provider]++
|
||||
}
|
||||
}
|
||||
}
|
||||
// suspendedByProvider := make(map[string]int)
|
||||
// if registration.SuspendedClients != nil {
|
||||
// for clientID := range registration.SuspendedClients {
|
||||
// if provider, ok := r.clientProviders[clientID]; ok && provider != "" {
|
||||
// suspendedByProvider[provider]++
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
for name, count := range registration.Providers {
|
||||
if count <= 0 {
|
||||
continue
|
||||
}
|
||||
adjusted := count - suspendedByProvider[name]
|
||||
if adjusted <= 0 {
|
||||
continue
|
||||
}
|
||||
providers = append(providers, providerCount{name: name, count: adjusted})
|
||||
// adjusted := count - suspendedByProvider[name]
|
||||
// if adjusted <= 0 {
|
||||
// continue
|
||||
// }
|
||||
// providers = append(providers, providerCount{name: name, count: adjusted})
|
||||
providers = append(providers, providerCount{name: name, count: count})
|
||||
}
|
||||
if len(providers) == 0 {
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user