{"record":{"id":"85d1d7029a5acd06","repo":"musistudio/claude-code-router","slug":"provider-link-is-too-long","errorCode":null,"errorMessage":"Provider link is too long.","messagePattern":"Provider link is too long\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/core/src/contracts/deep-link.ts","lineNumber":73,"sourceCode":"      id,\n      provider: parseProviderDeepLinkPayload(rawUrl),\n      rawUrl,\n      receivedAt: receivedAt.toISOString()\n    };\n  } catch (error) {\n    return {\n      error: error instanceof Error ? error.message : String(error),\n      id,\n      rawUrl,\n      receivedAt: receivedAt.toISOString()\n    };\n  }\n}\n\nexport function parseProviderManifestDeepLinkPayload(rawUrl: string): ProviderManifestDeepLinkPayload | undefined {\n  const value = rawUrl.trim();\n  if (value.length > maxDeepLinkLength) {\n    throw new Error(\"Provider link is too long.\");\n  }\n\n  const url = new URL(value);\n  if (url.protocol !== `${appDeepLinkProtocol}:`) {\n    throw new Error(\"Unsupported link protocol.\");\n  }\n\n  const host = url.hostname.toLowerCase();\n  const firstPathSegment = url.pathname.split(\"/\").filter(Boolean)[0]?.toLowerCase();\n  if (host !== providerDeepLinkHost && firstPathSegment !== providerDeepLinkHost) {\n    throw new Error(\"Unsupported CCR link target.\");\n  }\n\n  const payload = readPayloadRecord(url.searchParams);\n  const manifestUrl = boundedString(\n    firstStringParam(url.searchParams, [\"manifest\"]) ??\n      firstPayloadString(payload, [\"manifest\"]),\n    maxManifestUrlLength,","sourceCodeStart":55,"sourceCodeEnd":91,"githubUrl":"https://github.com/musistudio/claude-code-router/blob/99f24806c6a2c660b16e53e95211c517448a6c90/packages/core/src/contracts/deep-link.ts#L55-L91","documentation":"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.","triggerScenarios":"Calling parseProviderManifestDeepLinkPayload(rawUrl) with a trimmed URL whose length exceeds maxDeepLinkLength (e.g. an inline base64 payload param stuffed into the link).","commonSituations":"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.","solutions":["Shorten the link: move the manifest content to an https URL and pass only manifest=<url>","If embedding JSON, base64url-encode and trim optional fields (icon, description) to get under the cap","Check the link wasn't corrupted/duplicated by the transport (chat app, terminal) before parsing"],"exampleFix":"// before\nconst link = `ccr://provider/install?payload=${encodeURIComponent(JSON.stringify(bigManifest))}`;\n// after\nconst link = `ccr://provider/install?manifest=${encodeURIComponent(\"https://example.com/provider/manifest.json\")}`;","handlingStrategy":"validation","validationCode":"const ok = rawUrl.trim().length <= 2000 && rawUrl.trim().startsWith(\"ccr://\"); // match your maxDeepLinkLength","typeGuard":"const isParsableManifestLink = (u: string) =>\n  u.trim().length <= MAX_LEN && /^ccr:\\/\\//i.test(u.trim());","tryCatchPattern":"try { parseProviderManifestDeepLinkPayload(url); } catch (e) { if (e instanceof Error && e.message === \"Provider link is too long.\") return notifyUser(url); throw e; }","preventionTips":["Generate links with a manifest URL instead of inline payloads","Assert link length in your link-builder"],"tags":["deep-link","validation","input-length"],"backgroundTag":"deep-link-payload-too-large","analyzedSha":"99f24806c6a2c660b16e53e95211c517448a6c90","analyzedAt":"2026-08-27T04:11:01.184Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}