{"record":{"id":"c47652607f5f4a0d","repo":"diegosouzapw/OmniRoute","slug":"lease-capacity-unavailable","errorCode":"LEASE_CAPACITY_UNAVAILABLE","errorMessage":"Exclusive managed session capacity is temporarily unavailable","messagePattern":"Exclusive managed session capacity is temporarily unavailable","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/sse/services/leaseContext.ts","lineNumber":120,"sourceCode":"      ? \"LEASE_FENCE_STALE\"\n      : selection.leaseConnectionMismatch\n        ? \"LEASE_CONNECTION_MISMATCH\"\n        : null;\n  if (code)\n    return buildManagedLeaseErrorResponse(\n      new LeaseContextError(409, code, code.replaceAll(\"_\", \" \"))\n    );\n  if (!selection.waitingForCapacity) return null;\n  const expiryMs = Date.parse(selection.retryAfter ?? \"\");\n  const retryAfterSeconds = Number.isFinite(expiryMs)\n    ? Math.min(3600, Math.max(1, Math.ceil((expiryMs - Date.now()) / 1000)))\n    : 1;\n  return new Response(\n    JSON.stringify({\n      state: \"WAITING_FOR_CAPACITY\",\n      error: {\n        type: \"lease_error\",\n        code: \"LEASE_CAPACITY_UNAVAILABLE\",\n        message: \"Exclusive managed session capacity is temporarily unavailable\",\n      },\n      reason: \"NO_FREE_ELIGIBLE_CONNECTION\",\n      retryAfter: retryAfterSeconds,\n      eligibleCount: Math.max(0, selection.eligibleCount ?? 0),\n      freeCount: Math.max(0, selection.freeCount ?? 0),\n    }),\n    {\n      status: 429,\n      headers: {\n        \"Content-Type\": \"application/json\",\n        \"Retry-After\": String(retryAfterSeconds),\n      },\n    }\n  );\n}\n","sourceCodeStart":102,"sourceCodeEnd":137,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/sse/services/leaseContext.ts#L102-L137","documentation":"Error \"Exclusive managed session capacity is temporarily unavailable\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at src/sse/services/leaseContext.ts:120 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"}