fix(models): fix builtin provider detection and model matching (#120)

- Add glm-coding-plan to PROVIDER_ENV_MAP for proper env mapping
- Rename GLMCodingPlan value from 'glm' to 'glm-coding-plan' (kebab-case)
- Match custom providers against PROVIDER_PRESETS to reuse builtin models
- Fix provider key matching in create/update (use entry.name consistently)
- Clear stale base_url/api_key from config on provider create
- Clear model config when all providers are removed
- Add gateway restart on provider remove

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
ekko
2026-04-22 00:11:39 +08:00
committed by GitHub
parent c4bea63a5e
commit 83ad9642e2
4 changed files with 51 additions and 22 deletions
+2 -2
View File
@@ -59,8 +59,8 @@ export const PROVIDER_PRESETS: ProviderPreset[] = [
models: ['glm-5.1', 'glm-5', 'glm-5v-turbo', 'glm-5-turbo', 'glm-4.7', 'glm-4.5', 'glm-4.5-flash'],
},
{
label: 'GLMCodingPlan',
value: 'glm',
label: 'GLM-Coding-Plan',
value: 'glm-coding-plan',
builtin: true,
base_url: 'https://api.z.ai/api/anthropic',
models: ['glm-5.1', 'glm-5', 'glm-5-turbo', 'glm-4.7', 'glm-4.5', 'glm-4.5-flash'],