fix: OCG output includes provider field + Kimi collector uses membership/subscription page
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user