paperclipai/paperclip · error · Error

device-login promotion: the credential has no subscription i

Error message

device-login promotion: the credential has no subscription identity

What it means

Guard in promoteDeviceLoginCredential: the staged device-login credential passed the readiness check but has no subscription identity attached, so it cannot be promoted. The credential payload lacks the subscription binding the promotion path requires (distinct from shape validation failures like empty/oversized/API-key payloads, which fail earlier in assertUsableSubscriptionShape).

Source

Thrown at packages/adapters/codex-local/src/server/adapter-auth-promotion.ts:218

  const env = input.env ?? process.env;
  const companyId = requireSafeCompanyId(input.companyId);

  // 1. Independent readiness check on the exact staged credential. A non-ready
  //    result rejects the promotion before any validation or write.
  const readiness = await checkReadiness(authBytes);
  if (!readiness.ready) {
    throw new DeviceLoginReadinessError(readiness.reason ?? "not_ready");
  }

  // 2. Validate the credential with the export rules. This rejects an empty, an
  //    oversized, an API-key, a non-subscription, and a malformed payload.
  assertUsableSubscriptionShape(authBytes);
  const accountId = readSubscriptionAccountId(authBytes);
  if (!accountId) {
    // The shape gate above already guarantees a subscription identity; this guard
    // keeps the account_id non-null for the handle conversion without a non-null
    // cast.
    throw new Error("device-login promotion: the credential has no subscription identity");
  }

  // 2b. Convert the identity into a safe account handle. The handle names both
  //     this account's own home directory and its company secret, so a login
  //     whose identity cannot form one must fail before any write.
  const accountHandle = toAccountHandle(accountId);
  if (!accountHandle) {
    throw new Error("device-login promotion: the account identifier cannot form a valid account handle");
  }

  // 3. Decision C: only a user-initiated login seeds a home.
  if (!userInitiated) {
    await log("[paperclip] Codex device-login promotion: skipped (an automatic background login never seeds a home).");
    return { outcome: "background_skipped", accountId, accountHomeDir: null, accountHomeCreated: false };
  }

  // 4. Decision H: write only while the session still owns the active slot.
  const soleOwner = await isSoleActiveOwner();

View on GitHub (pinned to 01ad858492)

Solutions

  1. Re-run the device login flow with a subscription-backed account so the credential carries a subscription identity
  2. Confirm the account actually holds a subscription before promoting
  3. Retry the login; a partially captured credential may be missing the identity claim
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at packages/adapters/codex-local/src/server/adapter-auth-promotion.ts:218 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of paperclipai/paperclip@01ad858492 (2026-09-10). Data as JSON: /api/errors/1a93a317c862ba0e. Report an issue: GitHub.