{"record":{"id":"2b6c26f0ea50ca52","repo":"diegosouzapw/OmniRoute","slug":"custom-embedding-endpoint-is-invalid-or-blocked","errorCode":null,"errorMessage":"Custom embedding endpoint is invalid or blocked","messagePattern":"Custom embedding endpoint is invalid or blocked","errorType":"validation","errorClass":"MemoryCustomEmbeddingConfigError","httpStatus":null,"severity":"error","filePath":"src/lib/memory/embedding/customProvider.ts","lineNumber":33,"sourceCode":"  model: string;\n  identity: string;\n};\n\nexport class MemoryCustomEmbeddingConfigError extends Error {\n  constructor() {\n    super(\"Custom embedding endpoint is invalid or blocked\");\n    this.name = \"MemoryCustomEmbeddingConfigError\";\n  }\n}\n\nfunction validateEndpoint(rawBaseUrl: string): URL {\n  const guard = getProviderValidationGuard();\n  if (guard === \"public-only\") return parseAndValidatePublicUrl(rawBaseUrl);\n  return parseAndValidateNonMetadataUrl(rawBaseUrl);\n}\n\nfunction toEmbeddingsUrl(url: URL): string {\n  if (url.search || url.hash) throw new MemoryCustomEmbeddingConfigError();\n  const normalized = url.toString().replace(/\\/+$/, \"\");\n  return normalized.endsWith(\"/embeddings\") ? normalized : `${normalized}/embeddings`;\n}\n\nexport function resolveMemoryCustomEmbeddingProvider(\n  settings: CustomEmbeddingSettings\n): ResolvedMemoryCustomEmbeddingProvider | null {\n  const rawBaseUrl = settings.customBaseUrl?.trim() ?? \"\";\n  const model = settings.customModelId?.trim() ?? \"\";\n  if (!rawBaseUrl && !model) return null;\n  if (!rawBaseUrl || !model) throw new MemoryCustomEmbeddingConfigError();\n\n  try {\n    const baseUrl = toEmbeddingsUrl(validateEndpoint(rawBaseUrl));\n    return {\n      provider: {\n        id: \"memory-custom\",\n        baseUrl,","sourceCodeStart":15,"sourceCodeEnd":51,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/lib/memory/embedding/customProvider.ts#L15-L51","documentation":"Error \"Custom embedding endpoint is invalid or blocked\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at src/lib/memory/embedding/customProvider.ts:33 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d","analyzedAt":"2026-08-25T18:35:09.898Z","schemaVersion":2},"datasetVersion":"2026-08-25T21:54:21.419Z"}