{"record":{"id":"d02018101a7e0209","repo":"diegosouzapw/OmniRoute","slug":"device-authorization-response-missing-device-code","errorCode":null,"errorMessage":"Device authorization response missing device_code","messagePattern":"Device authorization response missing device_code","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/lib/oauth/providers/kimi-coding.ts","lineNumber":76,"sourceCode":"export const kimiCoding = {\n  config: KIMI_CODING_CONFIG,\n  flowType: \"device_code\",\n  requestDeviceCode: async (config) => {\n    const response = await fetch(config.deviceCodeUrl, {\n      method: \"POST\",\n      headers: getKimiOAuthHeaders(),\n      body: new URLSearchParams({\n        client_id: config.clientId,\n      }),\n    });\n\n    if (!response.ok) {\n      const error = await response.text();\n      throw new Error(`Device code request failed: ${error}`);\n    }\n\n    const data = await response.json();\n    if (!data?.device_code) throw new Error(\"Device authorization response missing device_code\");\n    if (!data?.user_code) throw new Error(\"Device authorization response missing user_code\");\n    if (!data?.verification_uri_complete) {\n      throw new Error(\"Device authorization response missing verification_uri_complete\");\n    }\n    return {\n      device_code: data.device_code,\n      user_code: data.user_code,\n      verification_uri: data.verification_uri || \"\",\n      verification_uri_complete: data.verification_uri_complete,\n      expires_in: data.expires_in,\n      interval: data.interval || 5,\n    };\n  },\n  pollToken: async (config, deviceCode) => {\n    const response = await fetch(config.tokenUrl, {\n      method: \"POST\",\n      headers: getKimiOAuthHeaders(),\n      body: new URLSearchParams({","sourceCodeStart":58,"sourceCodeEnd":94,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/lib/oauth/providers/kimi-coding.ts#L58-L94","documentation":"Error \"Device authorization response missing device_code\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at src/lib/oauth/providers/kimi-coding.ts:76 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d","analyzedAt":"2026-08-25T18:35:09.898Z","schemaVersion":2},"datasetVersion":"2026-08-25T21:54:21.419Z"}