fix: OCG output includes provider field + Kimi collector uses membership/subscription page

This commit is contained in:
hmo
2026-07-19 21:09:01 +08:00
parent bfb6bfba59
commit c1232ed382
2 changed files with 6 additions and 5 deletions
+1
View File
@@ -651,6 +651,7 @@ def collect_all(cdp_only=False):
cached = cache['accounts'][kid]
cached['key_id'] = kid
cached['label'] = acc_cfg.get('label', kid)
cached['provider'] = acc_cfg.get('provider', 'opencode_go')
cached['workspace_id'] = acc_cfg.get('workspace_id') or cached.get('workspace_id')
accounts_list.append(cached)
else:
+5 -5
View File
@@ -12,7 +12,7 @@ from pathlib import Path
from datetime import datetime, timezone
CDP = "http://localhost:3456"
KIMI_CONSOLE = "https://www.kimi.com/code/console"
KIMI_CONSOLE = "https://www.kimi.com/membership/subscription?tab=quota"
SCRIPT_DIR = Path(__file__).resolve().parent
GATEWAY_DIR = SCRIPT_DIR.parent
@@ -57,17 +57,17 @@ def main():
kimi_tab = None
for t in targets:
url = t.get("url", "")
if "kimi.com" in url:
if "kimi.com" in url or "moonshot.cn" in url:
kimi_tab = t
break
if kimi_tab:
target_id = kimi_tab.get("targetId") or kimi_tab.get("id")
print(f"[kimi] Found existing tab: {target_id}")
# Navigate to console if needed
# Navigate to quota page if needed
cur_url = kimi_tab.get("url", "")
if "code/console" not in cur_url:
print(f"[kimi] Navigating to console...")
if "membership" not in cur_url and "subscription" not in cur_url:
print(f"[kimi] Navigating to quota page...")
cdp_get(f"/navigate?target={target_id}&url={KIMI_CONSOLE}")
time.sleep(3)
else: