musistudio/claude-code-router · error · Error

Provider link is too long.

Error message

Provider link is too long.

What it means

parseProviderManifestDeepLinkPayload rejects provider manifest deep links longer than maxDeepLinkLength. The length cap is a hard input bound on ccr:// deep-link URLs carrying a manifest reference, preventing oversized URLs from reaching URL parsing or the manifest fetcher.

Source

Thrown at packages/core/src/contracts/deep-link.ts:73

      id,
      provider: parseProviderDeepLinkPayload(rawUrl),
      rawUrl,
      receivedAt: receivedAt.toISOString()
    };
  } catch (error) {
    return {
      error: error instanceof Error ? error.message : String(error),
      id,
      rawUrl,
      receivedAt: receivedAt.toISOString()
    };
  }
}

export function parseProviderManifestDeepLinkPayload(rawUrl: string): ProviderManifestDeepLinkPayload | undefined {
  const value = rawUrl.trim();
  if (value.length > maxDeepLinkLength) {
    throw new Error("Provider link is too long.");
  }

  const url = new URL(value);
  if (url.protocol !== `${appDeepLinkProtocol}:`) {
    throw new Error("Unsupported link protocol.");
  }

  const host = url.hostname.toLowerCase();
  const firstPathSegment = url.pathname.split("/").filter(Boolean)[0]?.toLowerCase();
  if (host !== providerDeepLinkHost && firstPathSegment !== providerDeepLinkHost) {
    throw new Error("Unsupported CCR link target.");
  }

  const payload = readPayloadRecord(url.searchParams);
  const manifestUrl = boundedString(
    firstStringParam(url.searchParams, ["manifest"]) ??
      firstPayloadString(payload, ["manifest"]),
    maxManifestUrlLength,

View on GitHub (pinned to 99f24806c6)

Solutions

  1. Shorten the link: move the manifest content to an https URL and pass only manifest=<url>
  2. If embedding JSON, base64url-encode and trim optional fields (icon, description) to get under the cap
  3. Check the link wasn't corrupted/duplicated by the transport (chat app, terminal) before parsing

Example fix

// before
const link = `ccr://provider/install?payload=${encodeURIComponent(JSON.stringify(bigManifest))}`;
// after
const link = `ccr://provider/install?manifest=${encodeURIComponent("https://example.com/provider/manifest.json")}`;
Defensive patterns

Strategy: validation

Validate before calling

const ok = rawUrl.trim().length <= 2000 && rawUrl.trim().startsWith("ccr://"); // match your maxDeepLinkLength

Type guard

const isParsableManifestLink = (u: string) =>
  u.trim().length <= MAX_LEN && /^ccr:\/\//i.test(u.trim());

Try / catch

try { parseProviderManifestDeepLinkPayload(url); } catch (e) { if (e instanceof Error && e.message === "Provider link is too long.") return notifyUser(url); throw e; }

Prevention

When it happens

Trigger: Calling parseProviderManifestDeepLinkPayload(rawUrl) with a trimmed URL whose length exceeds maxDeepLinkLength (e.g. an inline base64 payload param stuffed into the link).

Common situations: Generating deep links with an embedded oversized payload= parameter; hand-crafted or truncated/corrupted links pasted by users; a generator that inlines the whole manifest JSON instead of a manifest URL.

Related errors


AI-assisted analysis of musistudio/claude-code-router@99f24806c6 (2026-08-27). Data as JSON: /api/errors/85d1d7029a5acd06. Report an issue: GitHub.