From 8fa95f058a87c78ef42f4b75a9ea00057c89ad80 Mon Sep 17 00:00:00 2001 From: 6vision Date: Wed, 15 Apr 2026 21:48:50 +0800 Subject: [PATCH] fix: bot_type change notification never shown after model switch Made-with: Cursor --- plugins/cow_cli/cow_cli.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/cow_cli/cow_cli.py b/plugins/cow_cli/cow_cli.py index 8addc9c4..9dda19cc 100644 --- a/plugins/cow_cli/cow_cli.py +++ b/plugins/cow_cli/cow_cli.py @@ -379,11 +379,11 @@ class CowCliPlugin(Plugin): new_val = value_str updates = {key: new_val} + old_bot_type = conf().get("bot_type", "") - if key == "model" and conf().get("bot_type"): + if key == "model" and old_bot_type: from common import const - current_bot_type = conf().get("bot_type") - if current_bot_type not in (const.CUSTOM,): + if old_bot_type not in (const.CUSTOM,): resolved = self._resolve_bot_type_for_model(str(new_val)) if resolved: updates["bot_type"] = resolved @@ -405,8 +405,8 @@ class CowCliPlugin(Plugin): logger.warning(f"[CowCli] config reload warning: {e}") result = f"✅ 配置已更新\n\n {key}: {old_val} → {new_val}" - if "bot_type" in updates and updates["bot_type"] != conf().get("bot_type"): - result += f"\n bot_type: → {updates['bot_type']}" + if "bot_type" in updates and updates["bot_type"] != old_bot_type: + result += f"\n bot_type: {old_bot_type} → {updates['bot_type']}" return result @staticmethod