fix(xmpp_monitor): exclude key7(kimi) from auto-heal switch candidates
zhiwei must stay on ocg-key6 (deepseek-v4-flash) per user decision. key7 is kimi — different model provider, incompatible model name. If best_key returns key7, auto_heal logs skip_switch instead of switching.
This commit is contained in:
+10
-1
@@ -26,6 +26,8 @@ RESTART_COOLDOWN_FILE = LOG_DIR / "last_restart.txt"
|
||||
RESTART_COOLDOWN_SEC = 180 # 3 min: don't trigger another restart within 3 min of last
|
||||
|
||||
# Map AgentsMeeting key_id -> Hermes provider name
|
||||
# NOTE: key7 (kimi) is intentionally NOT in this map — different model provider.
|
||||
# zhiwei uses deepseek-v4-flash via OCG; auto_heal must never switch to kimi.
|
||||
KEY_TO_PROVIDER = {
|
||||
"key1": "ocg-new",
|
||||
"key2": "ocg-old",
|
||||
@@ -442,7 +444,14 @@ def auto_heal():
|
||||
# 如果 best key 对应的 provider 跟当前不同 → 切换
|
||||
target_provider = KEY_TO_PROVIDER.get(bk["key_id"])
|
||||
current = current_provider()
|
||||
if target_provider and target_provider != current:
|
||||
if target_provider is None:
|
||||
# best key is a non-OCG provider (e.g. key7=kimi) — never switch zhiwei there
|
||||
actions.append({
|
||||
"action": "skip_switch",
|
||||
"reason": f"best key {bk['key_id']} is non-OCG (not in KEY_TO_PROVIDER), zhiwei must stay on deepseek",
|
||||
"best_key": bk["key_id"],
|
||||
})
|
||||
elif target_provider != current:
|
||||
# 只有当 best key 自身至少 weekly ok 才切,否则切过去也白搭
|
||||
if bk["weekly"]["status"] == "ok":
|
||||
action = switch_key(bk["key_id"])
|
||||
|
||||
Reference in New Issue
Block a user