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:
Luis Pater
2025-09-24 21:09:36 +08:00
parent b86ed46845
commit a2c5fdaf66
8 changed files with 27 additions and 245 deletions

View File

@@ -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