continuedev/continue · error · Error

Invalid FQSN format: package slug must have two parts

Error message

Invalid FQSN format: package slug must have two parts

What it means

decodeFQSN splits a fully-qualified secret name into [secret, then owner/package pairs]. Package slugs consume parts two at a time; if an odd count remains, the last owner slug has no package slug and the FQSN is structurally invalid.

Source

Thrown at packages/config-yaml/src/interfaces/slugs.ts:187

export interface FQSN {
  packageSlugs: PackageSlug[];
  secretName: string;
}

export function encodeFQSN(fqsn: FQSN): string {
  const parts = [...fqsn.packageSlugs.map(encodePackageSlug), fqsn.secretName];
  return parts.join("/");
}

export function decodeFQSN(fqsn: string): FQSN {
  const parts = fqsn.split("/");
  const secretName = parts.pop()!;
  const packageSlugs: PackageSlug[] = [];

  // Process parts two at a time to decode package slugs
  for (let i = 0; i < parts.length; i += 2) {
    if (i + 1 >= parts.length) {
      throw new Error("Invalid FQSN format: package slug must have two parts");
    }
    packageSlugs.push({
      ownerSlug: parts[i],
      packageSlug: parts[i + 1],
    });
  }

  return { packageSlugs, secretName };
}

View on GitHub (pinned to 5522c6f44c)

Solutions

  1. Check the FQSN string: it must be owner/package pairs followed by the secret name, e.g. owner/package/secret-name
  2. If secret names contain slashes, rename them or fix the encoder
  3. Validate with decodeFQSN.try pattern (safeParse-style wrapper) before use

Example fix

// before
decodeFQSN('my-owner');
// after
decodeFQSN('my-owner/my-package/my-secret');
Defensive patterns

Strategy: validation

Validate before calling

function isValidFQSN(fqsn: string): boolean {
  const parts = fqsn.split('/');
  return parts.length >= 3 && (parts.length - 1) % 2 === 0;
}

Try / catch

try { decodeFQSN(s); } catch (e) { /* report invalid FQSN string to user */ }

Prevention

When it happens

Trigger: decodeFQSN('owner') or decodeFQSN('secret1/owner/pkg/owner2') — any string where, after removing the secret name, the remaining segments are not evenly divisible into owner/package pairs.

Common situations: Hand-written FQSN strings, a secret name containing '/' being misparsed, or copy/paste truncating the FQSN.

Related errors


AI-assisted analysis of continuedev/continue@5522c6f44c (2026-08-27). Data as JSON: /api/errors/8e70f170124c322b. Report an issue: GitHub.