refactor(hermes): drop config health check scanner

The Hermes config.yaml schema has stabilized and users have migrated to
the current provider fields, so the value of scanning for model.provider
dangling references, custom_providers shape errors, v12 migration residue
etc. no longer justifies the maintenance surface — and the scan produces
false positives when users keep some providers under Hermes' v12+
providers: dict (Hermes' runtime merges both shapes, but CC Switch's
scanner only looked at the list form).

Removes the whole HermesHealthWarning type, scan_hermes_config_health
command, HermesHealthBanner React component, useHermesHealth hook,
warnings field on HermesWriteOutcome, and the three helper functions
(yaml_as_non_empty_str, collect_mapping_string_keys, hermes_warning)
that only served the scanner. Drops the matching i18n keys in
zh/en/ja and the fixInWebUI button label that only the banner used.
This commit is contained in:
Jason
2026-04-23 11:59:25 +08:00
parent dc04165f18
commit cdcc423122
11 changed files with 4 additions and 561 deletions
-14
View File
@@ -1682,26 +1682,12 @@
"open": "Open Hermes Web UI",
"offline": "Hermes Web UI is not running. Start it with `hermes dashboard` first.",
"openFailed": "Failed to open Hermes Web UI",
"fixInWebUI": "Fix in Hermes Web UI",
"launchConfirmTitle": "Hermes Dashboard is not running",
"launchConfirmMessage": "Open a terminal and start it now with `hermes dashboard`?\n\nThe browser will open automatically once startup completes.\n\nIf the terminal reports that `hermes` cannot be found or the web extras are missing, run first:\npip install hermes-agent[web]",
"launchConfirmAction": "Open terminal & launch",
"launching": "Started `hermes dashboard` in a terminal.",
"launchFailed": "Failed to open terminal"
},
"health": {
"title": "Hermes config warnings detected",
"parseFailed": "config.yaml could not be parsed as valid YAML. Fix the file before editing it here.",
"configNotFound": "Hermes config.yaml not found. Create it at ~/.hermes/config.yaml or configure the path in settings.",
"envParseFailed": "The .env file could not be parsed.",
"modelNoDefault": "No default model or provider is configured in the 'model' section.",
"customProvidersNotList": "custom_providers should be a YAML list (items prefixed with '-'), not a mapping.",
"modelProviderUnknown": "model.provider references a provider that is not configured.",
"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' newer schema moved some providers into the 'providers:' dict. They are shown read-only in CC Switch — edit or remove those entries via Hermes Web UI."
},
"memory": {
"title": "Memory",
"agentTab": "Agent Memory (MEMORY.md)",
-14
View File
@@ -1682,26 +1682,12 @@
"open": "Hermes Web UI を開く",
"offline": "Hermes Web UI が起動していません。まず `hermes dashboard` を実行してください。",
"openFailed": "Hermes Web UI を開けませんでした",
"fixInWebUI": "Hermes Web UI で修正",
"launchConfirmTitle": "Hermes Dashboard が起動していません",
"launchConfirmMessage": "ターミナルを開いて `hermes dashboard` を実行しますか?\n\n起動完了後、ブラウザが自動的に開きます。\n\nターミナルに `hermes` が見つからない、または web 依存が不足するというエラーが表示される場合は、まず次を実行してください:\npip install hermes-agent[web]",
"launchConfirmAction": "ターミナルを開いて起動",
"launching": "ターミナルで hermes dashboard を起動しました。",
"launchFailed": "ターミナルを開けませんでした"
},
"health": {
"title": "Hermes 設定の警告を検出",
"parseFailed": "config.yaml を有効な YAML として解析できません。ここで編集する前にファイルを修正してください。",
"configNotFound": "Hermes config.yaml が見つかりません。~/.hermes/config.yaml に作成するか、設定でパスを構成してください。",
"envParseFailed": ".env ファイルを解析できません。",
"modelNoDefault": "'model' セクションに既定モデルまたはプロバイダーが設定されていません。",
"customProvidersNotList": "custom_providers はマッピングではなく、YAML リスト('-' で始まる項目)である必要があります。",
"modelProviderUnknown": "model.provider が指すプロバイダーは設定に存在しません。",
"modelDefaultNotInProvider": "model.default は選択中のプロバイダーのモデル一覧に含まれていません。",
"duplicateProviderName": "custom_providers にプロバイダー名の重複があります。1 件のみ有効になります。",
"duplicateProviderBaseUrl": "custom_providers に重複した base_url があります。誤ってコピーされた可能性があります。",
"schemaMigratedV12": "Hermes の新しいスキーマでは一部のプロバイダーが 'providers:' dict に移動しました。CC Switch では読み取り専用で表示されます。編集・削除は Hermes Web UI から行ってください。"
},
"memory": {
"title": "メモリ",
"agentTab": "エージェント記憶 (MEMORY.md)",
-14
View File
@@ -1682,26 +1682,12 @@
"open": "打开 Hermes Web UI",
"offline": "Hermes Web UI 未启动,请先运行 `hermes dashboard` 启动服务。",
"openFailed": "打开 Hermes Web UI 失败",
"fixInWebUI": "在 Hermes Web UI 修复",
"launchConfirmTitle": "Hermes Dashboard 未启动",
"launchConfirmMessage": "是否打开终端并运行 `hermes dashboard` 启动服务?\n\n启动完成后会自动打开浏览器。\n\n若终端提示找不到 hermes 或缺少 web 依赖,请先运行:\npip install hermes-agent[web]",
"launchConfirmAction": "打开终端并启动",
"launching": "已在终端启动 hermes dashboard",
"launchFailed": "打开终端失败"
},
"health": {
"title": "检测到 Hermes 配置警告",
"parseFailed": "config.yaml 无法解析为有效 YAML。请先修复文件再在此编辑。",
"configNotFound": "未找到 Hermes config.yaml。请在 ~/.hermes/config.yaml 创建或在设置中配置路径。",
"envParseFailed": ".env 文件无法解析。",
"modelNoDefault": "model 段未设置默认模型或供应商。",
"customProvidersNotList": "custom_providers 应为 YAML 列表(以 `-` 开头),而不是映射。",
"modelProviderUnknown": "model.provider 指向的供应商未在配置中找到。",
"modelDefaultNotInProvider": "model.default 指向的模型不在所选供应商的模型列表中。",
"duplicateProviderName": "custom_providers 中存在重复的供应商名,只会有一条生效。",
"duplicateProviderBaseUrl": "custom_providers 中存在重复的 base_url,可能是意外复制。",
"schemaMigratedV12": "Hermes 新版 schema 把部分供应商移到了 'providers:' dict。CC Switch 中以只读方式显示,编辑或删除请通过 Hermes Web UI 操作。"
},
"memory": {
"title": "记忆管理",
"agentTab": "Agent 记忆 (MEMORY.md)",