{"record":{"id":"da9854eb3614ae02","repo":"diegosouzapw/OmniRoute","slug":"timeout","errorCode":"timeout","errorMessage":"Authorization timed out. Start a new session.","messagePattern":"Authorization timed out\\. Start a new session\\.","errorType":"exception","errorClass":"CodexDeviceFlowError","httpStatus":null,"severity":"error","filePath":"src/lib/oauth/codexDeviceFlow.ts","lineNumber":201,"sourceCode":"/**\n * Step 2 — poll until the user authorizes. Returns the authorization_code and the\n * server-generated code_verifier needed for the token exchange.\n */\nexport async function pollForAuthorization(\n  deviceAuthId: string,\n  userCode: string,\n  intervalSec: number,\n  opts: { signal?: AbortSignal; timeoutMs?: number } = {}\n): Promise<{ authorizationCode: string; codeVerifier: string }> {\n  const { signal, timeoutMs = DEFAULT_TIMEOUT_MS } = opts;\n  const deadline = startMonotonic() + timeoutMs;\n\n  while (true) {\n    throwIfAborted(signal);\n    await delay(intervalSec * 1000, signal);\n\n    if (startMonotonic() >= deadline) {\n      throw new CodexDeviceFlowError(\"timeout\", \"Authorization timed out. Start a new session.\");\n    }\n\n    let res: Response;\n    try {\n      res = await fetch(`${API_BASE_URL}/deviceauth/token`, {\n        method: \"POST\",\n        headers: { \"Content-Type\": \"application/json\", Accept: \"application/json\" },\n        body: JSON.stringify({ device_auth_id: deviceAuthId, user_code: userCode }),\n        signal,\n      });\n    } catch (e: any) {\n      if (e?.name === \"AbortError\")\n        throw new CodexDeviceFlowError(\"aborted\", \"Device flow aborted\");\n      // Transient network error — keep polling until the deadline.\n      continue;\n    }\n\n    if (res.ok) {","sourceCodeStart":183,"sourceCodeEnd":219,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/lib/oauth/codexDeviceFlow.ts#L183-L219","documentation":"Error \"Authorization timed out. Start a new session.\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at src/lib/oauth/codexDeviceFlow.ts:201 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"}