mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-05-24 14:50:20 +08:00
31fb998575
Drops the v11→v12 providers-dict compat layer: CC Switch now only reads/writes `custom_providers:`, leaving migrated `providers:` dict entries to Hermes Web UI for reconciliation (Hermes' runtime already merges both shapes via `get_compatible_custom_providers`). The `schema_migrated_v12` health warning now points users there when a dict-migrated config is detected. Adds forward-compat merge to `set_provider`: when updating an existing entry, on-disk fields the UI payload didn't submit (e.g. Hermes-only `request_timeout_seconds`, `key_env`) are carried over. Without this, editing one field via CC Switch would silently strip the rest. Adds `set_memory_enabled` + `set_hermes_memory_enabled` Tauri command for the upcoming memory-switch UI. Writes go through a merge-aware section replacement so character budgets and external-provider fields survive toggle operations. Removes four dict-only helpers (`normalize_providers_dict_entry_for_read`, `rename_alias_key`, `json_obj_non_empty_str`, `resolve_provider_name_from_yaml_entry`) and the multi-section write helper. Simplifies `get_providers` / `remove_provider` / health scan back to list-only. Replaces nine obsolete dict-related tests with `set_provider_preserves_unknown_fields_on_update` and `set_memory_enabled_preserves_other_fields`.