{"record":{"id":"4fe111a72aaf78e0","repo":"HKUDS/Vibe-Trading","slug":"feishu-lark-registration-does-not-support-client","errorCode":null,"errorMessage":"Feishu / Lark registration does not support client_secret auth. Supported: {methods}","messagePattern":"Feishu / Lark registration does not support client_secret auth\\. Supported: (.+?)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"agent/src/channels/feishu.py","lineNumber":483,"sourceCode":"        url,\n        data=body,\n        timeout=_ONBOARD_REQUEST_TIMEOUT_S,\n        headers={\"Content-Type\": \"application/x-www-form-urlencoded\"},\n    )\n    try:\n        return resp.json()\n    except json.JSONDecodeError:\n        resp.raise_for_status()\n        return {}\n\n\ndef _init_registration(domain: str = \"feishu\") -> None:\n    \"\"\"Verify the environment supports client_secret auth. Raises RuntimeError if not.\"\"\"\n    base_url = _accounts_base_url(domain)\n    res = _post_registration(base_url, {\"action\": \"init\"})\n    methods = res.get(\"supported_auth_methods\") or []\n    if \"client_secret\" not in methods:\n        raise RuntimeError(\n            f\"Feishu / Lark registration does not support client_secret auth. \"\n            f\"Supported: {methods}\"\n        )\n\n\ndef _begin_registration(domain: str = \"feishu\") -> dict:\n    \"\"\"Start the device-code flow. Returns device_code, qr_url, interval, expire_in.\"\"\"\n    base_url = _accounts_base_url(domain)\n    res = _post_registration(base_url, {\n        \"action\": \"begin\",\n        \"archetype\": \"PersonalAgent\",\n        \"auth_method\": \"client_secret\",\n        \"request_user_info\": \"open_id\",\n    })\n    device_code = res.get(\"device_code\")\n    if not device_code:\n        raise RuntimeError(\"Feishu / Lark registration did not return a device_code\")\n    qr_url = res.get(\"verification_uri_complete\", \"\")","sourceCodeStart":465,"sourceCodeEnd":501,"githubUrl":"https://github.com/HKUDS/Vibe-Trading/blob/80ffdda44c5c4db0dd84d70e051cca591cea67df/agent/src/channels/feishu.py#L465-L501","documentation":"Feishu/Lark QR registration uses client_secret auth; the registration init endpoint reports which auth methods the server supports, and if client_secret isn't among them a RuntimeError is raised. This typically indicates server-side capability or app-type mismatch.","triggerScenarios":"Calling _init_registration (via QR login flow) when the registration endpoint's supported_auth_methods list lacks 'client_secret' — wrong app archetype, unsupported Feishu region/domain, or server-side policy change.","commonSituations":"Using a Lark (international) vs Feishu (CN) domain mismatch, custom app credentials of the wrong type (store/ISV app), or the registration API being updated to deprecate client_secret.","solutions":["Verify domain: pass domain='feishu' for CN or 'lark' for international as appropriate for your app","Check the app type in the Feishu open platform — it must support client_secret (token) auth","Confirm app_id/app_secret are for a custom app, not an ISV/store app","Inspect the raw response: the error lists the actually supported methods, which reveals what changed"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"res = post(base_url, {'action':'init'})\nassert 'client_secret' in (res.get('supported_auth_methods') or []), 'auth method unsupported'","typeGuard":null,"tryCatchPattern":"try:\n    qr_register(domain='feishu')\nexcept RuntimeError as e:\n    if 'client_secret' in str(e): fall_back_to_manual_token_flow()\n    raise","preventionTips":["Match domain (feishu vs lark) to your app","Confirm the app type supports client_secret auth before starting QR login"],"tags":["feishu","auth","registration","oauth"],"backgroundTag":"auth-method-not-supported","analyzedSha":"80ffdda44c5c4db0dd84d70e051cca591cea67df","analyzedAt":"2026-08-28T12:46:38.989Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}