{"record":{"id":"cd3c7f117b225186","repo":"vercel/ai","slug":"acp-gateway-profile-values-are-unavailable","errorCode":null,"errorMessage":"ACP Gateway profile values are unavailable.","messagePattern":"ACP Gateway profile values are unavailable\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/harness-acp/src/v1/bridge/protocol-configuration.ts","lineNumber":136,"sourceCode":"}): Readonly<Record<string, unknown>> {\n  const result: Record<string, unknown> = { ...left };\n  for (const [key, value] of Object.entries(right)) {\n    const previous = result[key];\n    result[key] =\n      isRecord(previous) && isRecord(value)\n        ? mergeRecords({ left: previous, right: value })\n        : value;\n  }\n  return result;\n}\n\nfunction requireGateway({\n  gateway,\n}: {\n  gateway: ACPGatewayValues | undefined;\n}): ACPGatewayValues {\n  if (gateway == null) {\n    throw new Error('ACP Gateway profile values are unavailable.');\n  }\n  return gateway;\n}\n\nfunction asRecord(value: unknown): Readonly<Record<string, unknown>> {\n  if (!isRecord(value)) {\n    throw new Error('ACP profile data must resolve to an object.');\n  }\n  return value;\n}\n\nfunction isRecord(value: unknown): value is Readonly<Record<string, unknown>> {\n  return value != null && typeof value === 'object' && !Array.isArray(value);\n}\n","sourceCodeStart":118,"sourceCodeEnd":151,"githubUrl":"https://github.com/vercel/ai/blob/69428b1f8b037e4d118fb4853428d5c4e620493c/packages/harness-acp/src/v1/bridge/protocol-configuration.ts#L118-L151","documentation":"requireGateway ensures the resolved ACP configuration contains a gateway profile (ACPGatewayValues) before the bridge reads its fields. When the resolved profile has no gateway values (gateway == null), the library throws because downstream code cannot build protocol configuration without them.","triggerScenarios":"Calling requireGateway (via resolved) on a profile whose resolution yielded an undefined gateway — e.g. an ACP implementation/profile configured without gateway values, or a lookup that failed to populate gateway settings.","commonSituations":"A profile defined in config without the gateway section; a profile name typo causing resolution of an incomplete record; environment-specific config where gateway values are provisioned differently and missing locally.","solutions":["Add/repair the gateway values in the ACP profile being resolved so gateway is defined.","Check that the correct profile is being resolved (profile id/name typo).","Verify the profile resolution step (e.g. loading from config/env) actually populates gateway values.","Guard the call site: only invoke resolved/requireGateway after confirming the profile has gateway data."],"exampleFix":"// before\nconst cfg = resolved({ profile: profiles['dev'] }); // profile has no gateway\n// after\nconst profile = profiles['dev'];\nif (!profile?.gateway) throw new Error('Profile dev is missing gateway values');\nconst cfg = resolved({ profile });","handlingStrategy":"validation","validationCode":"if (profile?.gateway == null) {\n  throw new Error(`Profile '${profile?.id ?? 'unknown'}' has no gateway values`);\n}","typeGuard":"function hasGateway(profile: unknown): profile is { gateway: ACPGatewayValues } {\n  return profile != null && typeof profile === 'object' && !Array.isArray(profile) &&\n    (profile as any).gateway != null;\n}","tryCatchPattern":null,"preventionTips":["Validate profile config with a schema (e.g. zod) at load time.","Keep gateway values in version-controlled, environment-specific config files.","Fail fast at config load, not at bridge resolution."],"tags":["acp","configuration","gateway"],"backgroundTag":"missing-config-value","analyzedSha":"69428b1f8b037e4d118fb4853428d5c4e620493c","analyzedAt":"2026-08-30T12:32:21.016Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}