diegosouzapw/OmniRoute · error · CodexResetCreditError

exclusive_lease_active

exclusive_lease_active

Error message

Reset-credit operations are deferred while an exclusive lease is active.

What it means

Error "Reset-credit operations are deferred while an exclusive lease is active." thrown in diegosouzapw/OmniRoute.

Source

Thrown at src/lib/usage/codexResetCredits.ts:308

  const headers: Record<string, string> = {
    Authorization: `Bearer ${connection.accessToken}`,
    "Content-Type": "application/json",
    Accept: "application/json",
    // Canonical Codex backend identity (UA + originator + version), same
    // chain as inference — see getCodexUsage.
    ...getCodexBackendIdentityHeaders(),
  };

  const workspaceId = getWorkspaceId(connection);
  if (workspaceId) headers["chatgpt-account-id"] = workspaceId;

  return headers;
}

async function loadCodexConnection(connectionId: string): Promise<CodexConnectionLike> {
  if (await isConnectionUnavailableToAuxiliaryActivity(connectionId)) {
    throw new CodexResetCreditError(
      409,
      "exclusive_lease_active",
      "Reset-credit operations are deferred while an exclusive lease is active."
    );
  }
  const connection = (await getProviderConnectionById(
    connectionId
  )) as unknown as CodexConnectionLike | null;

  if (!connection) {
    throw new CodexResetCreditError(404, "connection_not_found", "Connection not found.");
  }

  if (connection.provider !== "codex") {
    throw new CodexResetCreditError(
      400,
      "codex_provider_required",
      "Reset credits can only be redeemed for OpenAI Codex accounts."

View on GitHub (pinned to a179ffed5b)

When it happens

Trigger: Thrown at src/lib/usage/codexResetCredits.ts:308 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25). Data as JSON: /api/errors/457f9376b25fd2f4. Report an issue: GitHub.