fix(hermes): prevent YAML pollution and drop of OAuth mcp auth

DeepLink Hermes import was emitting camelCase (baseUrl / apiKey /
apiMode) that the Hermes runtime does not recognise, poisoning
`custom_providers:` entries on activation. The MCP sync path was
also stripping `auth: oauth` on round-trip, silently downgrading
OAuth-type servers to unauthenticated calls.

The Hermes deeplink branch now emits snake_case via a dedicated
builder; `sanitize_hermes_provider_keys` runs on both `set_provider`
and `get_providers` so legacy DB records heal on next access.
`HERMES_EXTRA_FIELDS` preserves `auth`. The `api_mode` dropdown gains
`codex_responses` (Copilot / OpenCode), and the schema-migrated
warning copy no longer hard-codes "v12" (upstream `_config_version`
is now 19).
This commit is contained in:
Jason
2026-04-20 10:28:51 +08:00
parent 185ac2be9b
commit e10a300c80
9 changed files with 327 additions and 10 deletions
+2 -1
View File
@@ -1653,6 +1653,7 @@
"apiModeAuto": "Auto-detect",
"apiModeChatCompletions": "OpenAI Chat Completions",
"apiModeAnthropicMessages": "Anthropic Messages",
"apiModeCodexResponses": "Codex Responses (Copilot / OpenCode)",
"models": "Models",
"addModel": "Add model",
"noModels": "No models configured. Switching to this provider won't change the default model.",
@@ -1684,7 +1685,7 @@
"modelDefaultNotInProvider": "model.default is not in the selected provider's models list.",
"duplicateProviderName": "custom_providers contains duplicate provider names — only one entry will be used.",
"duplicateProviderBaseUrl": "custom_providers contains duplicate base_urls — possible accidental copy.",
"schemaMigratedV12": "Hermes moved some providers into the 'providers:' dict. CC Switch only manages 'custom_providers:' — edit or remove those entries via Hermes Web UI."
"schemaMigratedV12": "Hermes' newer schema moved some providers into the 'providers:' dict. CC Switch only manages 'custom_providers:' — edit or remove those entries via Hermes Web UI."
},
"memory": {
"title": "Memory",
+2 -1
View File
@@ -1653,6 +1653,7 @@
"apiModeAuto": "自動検出",
"apiModeChatCompletions": "OpenAI Chat Completions",
"apiModeAnthropicMessages": "Anthropic Messages",
"apiModeCodexResponses": "Codex ResponsesCopilot / OpenCode",
"models": "モデル一覧",
"addModel": "モデルを追加",
"noModels": "モデル未設定。このプロバイダーに切り替えてもデフォルトモデルは更新されません。",
@@ -1684,7 +1685,7 @@
"modelDefaultNotInProvider": "model.default は選択中のプロバイダーのモデル一覧に含まれていません。",
"duplicateProviderName": "custom_providers にプロバイダー名の重複があります。1 件のみ有効になります。",
"duplicateProviderBaseUrl": "custom_providers に重複した base_url があります。誤ってコピーされた可能性があります。",
"schemaMigratedV12": "Hermes は一部のプロバイダー 'providers:' dict に移しました。CC Switch は 'custom_providers:' のみを管理します。該当する項目は Hermes Web UI で編集・削除してください。"
"schemaMigratedV12": "Hermes の新しいスキーマでは一部のプロバイダー 'providers:' dict に移しました。CC Switch は 'custom_providers:' のみを管理します。該当する項目は Hermes Web UI で編集・削除してください。"
},
"memory": {
"title": "メモリ",
+2 -1
View File
@@ -1653,6 +1653,7 @@
"apiModeAuto": "自动检测",
"apiModeChatCompletions": "OpenAI Chat Completions",
"apiModeAnthropicMessages": "Anthropic Messages",
"apiModeCodexResponses": "Codex ResponsesCopilot / OpenCode",
"models": "模型列表",
"addModel": "添加模型",
"noModels": "暂无模型配置。切换到此供应商时将不会更新默认模型。",
@@ -1684,7 +1685,7 @@
"modelDefaultNotInProvider": "model.default 指向的模型不在所选供应商的模型列表中。",
"duplicateProviderName": "custom_providers 中存在重复的供应商名,只会有一条生效。",
"duplicateProviderBaseUrl": "custom_providers 中存在重复的 base_url,可能是意外复制。",
"schemaMigratedV12": "Hermes 把部分供应商移到了 'providers:' dict。CC Switch 只管理 'custom_providers:',请在 Hermes Web UI 编辑或删除这些条目。"
"schemaMigratedV12": "Hermes 新版 schema 把部分供应商移到了 'providers:' dict。CC Switch 只管理 'custom_providers:',请在 Hermes Web UI 编辑或删除这些条目。"
},
"memory": {
"title": "记忆管理",