{"record":{"id":"457f9376b25fd2f4","repo":"diegosouzapw/OmniRoute","slug":"exclusive-lease-active","errorCode":"exclusive_lease_active","errorMessage":"Reset-credit operations are deferred while an exclusive lease is active.","messagePattern":"Reset-credit operations are deferred while an exclusive lease is active\\.","errorType":"exception","errorClass":"CodexResetCreditError","httpStatus":409,"severity":"error","filePath":"src/lib/usage/codexResetCredits.ts","lineNumber":308,"sourceCode":"\n  const headers: Record<string, string> = {\n    Authorization: `Bearer ${connection.accessToken}`,\n    \"Content-Type\": \"application/json\",\n    Accept: \"application/json\",\n    // Canonical Codex backend identity (UA + originator + version), same\n    // chain as inference — see getCodexUsage.\n    ...getCodexBackendIdentityHeaders(),\n  };\n\n  const workspaceId = getWorkspaceId(connection);\n  if (workspaceId) headers[\"chatgpt-account-id\"] = workspaceId;\n\n  return headers;\n}\n\nasync function loadCodexConnection(connectionId: string): Promise<CodexConnectionLike> {\n  if (await isConnectionUnavailableToAuxiliaryActivity(connectionId)) {\n    throw new CodexResetCreditError(\n      409,\n      \"exclusive_lease_active\",\n      \"Reset-credit operations are deferred while an exclusive lease is active.\"\n    );\n  }\n  const connection = (await getProviderConnectionById(\n    connectionId\n  )) as unknown as CodexConnectionLike | null;\n\n  if (!connection) {\n    throw new CodexResetCreditError(404, \"connection_not_found\", \"Connection not found.\");\n  }\n\n  if (connection.provider !== \"codex\") {\n    throw new CodexResetCreditError(\n      400,\n      \"codex_provider_required\",\n      \"Reset credits can only be redeemed for OpenAI Codex accounts.\"","sourceCodeStart":290,"sourceCodeEnd":326,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/lib/usage/codexResetCredits.ts#L290-L326","documentation":"Error \"Reset-credit operations are deferred while an exclusive lease is active.\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at src/lib/usage/codexResetCredits.ts:308 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"}