fix: model switch reset, custom provider resolution and base_url_env cleanup (#212)

* fix: reset entire config.model on model switch

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: resolve custom provider from CLI config and clean base_url_env on delete

- When config.model.provider is "custom" (set by hermes CLI), match
  base_url + model against custom_providers to resolve custom:name
- Clear base_url_env from .env when deleting a builtin provider

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
ekko
2026-04-25 19:38:46 +08:00
committed by GitHub
parent 00c6b9532c
commit bc9b43f06a
2 changed files with 14 additions and 3 deletions
@@ -143,6 +143,7 @@ export async function remove(ctx: any) {
const envMapping = PROVIDER_ENV_MAP[poolKey]
if (envMapping?.api_key_env) {
await saveEnvValue(envMapping.api_key_env, '')
if (envMapping.base_url_env) { await saveEnvValue(envMapping.base_url_env, '') }
} else if (!envMapping?.api_key_env) {
try {
const authPath = getActiveAuthPath()