fix: disable SenseNova+Kimi usage collectors (CDP consent spam)

This commit is contained in:
hmo
2026-08-24 05:40:29 +08:00
parent 39a73db9b3
commit df3a630084
2 changed files with 22 additions and 22 deletions
+16 -22
View File
@@ -1462,17 +1462,17 @@ def api_usage_refresh():
if proc.returncode != 0 and proc.stderr:
log.warning(f"usage_collector stderr:\n{proc.stderr[-1000:]}")
# 2. Kimi 远程采集(SSH 到 Windows+ scp 回 246
try:
_collect_kimi_usage()
except Exception as e:
log.warning(f"usage: Kimi collection failed: {e}")
# 2. Kimi 远程采集(已禁用 by xxm 2026-08-22CDP弹窗骚扰)
# try:
# _collect_kimi_usage()
# except Exception as e:
# log.warning(f"usage: Kimi collection failed: {e}")
# 3. SenseNova 远程采集(SSH 到 WindowsCDP 刮 console 余量
try:
_collect_sensenova_usage()
except Exception as e:
log.warning(f"usage: SenseNova collection failed: {e}")
# 3. SenseNova 远程采集(已禁用 by xxm 2026-08-22
# try:
# _collect_sensenova_usage()
# except Exception as e:
# log.warning(f"usage: SenseNova collection failed: {e}")
except Exception as e:
log.error(f"usage: collector crash: {e}")
finally:
@@ -1666,17 +1666,11 @@ def _start_usage_auto_timer():
if proc.returncode != 0 and proc.stderr:
log.warning(f"usage auto-timer stderr:\n{proc.stderr[-800:]}")
# Kimi/SenseNova:每 30 分钟刷新一次(SSH 到 Windows + CDP,较重)
tick += 1
if tick % _KIMI_INTERVAL_MULT == 0:
try:
_collect_kimi_usage()
except Exception as e:
log.warning(f"usage auto-timer: Kimi failed: {e}")
try:
_collect_sensenova_usage()
except Exception as e:
log.warning(f"usage auto-timer: SenseNova failed: {e}")
# Kimi/SenseNova auto-timer disabled by xxm 2026-08-22 (CDP弹窗骚扰)
# tick += 1
# if tick % _KIMI_INTERVAL_MULT == 0:
# _collect_kimi_usage()
# _collect_sensenova_usage()
_usage_collector_running = False
except Exception as e:
log.error(f"usage auto-timer error: {e}")
@@ -2006,7 +2000,7 @@ def api_wechat_trigger_login():
import urllib.request as _ur
try:
req = _ur.Request(
"http://127.0.0.1:3001/api/bot/login",
"http://127.0.0.1:3001/api/bot/login?token=mowechat_fixed_token_001",
data=b"",
headers={"Content-Type": "application/json"},
method="POST",
@@ -25,6 +25,12 @@ GATEWAY_DIR = SCRIPT_DIR.parent
TEMP_DIR = GATEWAY_DIR / "temp"
os.makedirs(str(TEMP_DIR), exist_ok=True)
# 停止标记:存在此文件时脚本立即退出
STOP_FILE = SCRIPT_DIR / "STOP_SENSNOVA_COLLECT"
if STOP_FILE.exists():
print(f"[STOPPED] {STOP_FILE.name} exists, exiting.")
sys.exit(0)
OUTPUT_FILE = TEMP_DIR / "usage_stats_sensenova.json"
PROVIDER = "sensenova"