{"record":{"id":"53e6c6f3f6b1275c","repo":"vercel/ai","slug":"missing-name","errorCode":null,"errorMessage":"Missing ${name}.","messagePattern":"Missing (.+?)\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"packages/harness-acp/src/v1/bridge/host-tool-mcp.ts","lineNumber":178,"sourceCode":"  };\n}\n\nfunction readErrorMessage({\n  value,\n  status,\n}: {\n  value: unknown;\n  status: number;\n}): string {\n  return isRecord(value) && typeof value.error === 'string'\n    ? value.error\n    : `Host tool relay returned HTTP ${status}.`;\n}\n\nfunction requireEnvironmentVariable({ name }: { name: string }): string {\n  const value = env[name];\n  if (value == null || value.length === 0) {\n    throw new Error(`Missing ${name}.`);\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":160,"sourceCodeEnd":186,"githubUrl":"https://github.com/vercel/ai/blob/69428b1f8b037e4d118fb4853428d5c4e620493c/packages/harness-acp/src/v1/bridge/host-tool-mcp.ts#L160-L186","documentation":"Thrown by requireEnvironmentVariable when a required environment variable is unset or an empty string. The bridge requires three at module load: AI_SDK_ACP_HOST_TOOLS_FILE, AI_SDK_ACP_HOST_TOOL_RELAY_URL, and AI_SDK_ACP_HOST_TOOL_RELAY_CREDENTIAL, so a missing variable fails startup immediately with 'Missing <NAME>.'.","triggerScenarios":"Starting the bridge process with any of AI_SDK_ACP_HOST_TOOLS_FILE, AI_SDK_ACP_HOST_TOOL_RELAY_URL, or AI_SDK_ACP_HOST_TOOL_RELAY_CREDENTIAL undefined, set to the empty string, or not exported into the process environment.","commonSituations":"Running the bridge outside the environment that provisions it (e.g. launching the MCP server manually from an editor instead of the host app); .env file not loaded; variable misspelled; credential not yet provisioned; CI/deploy environment lacking the secret.","solutions":["Read the thrown message to identify which variable is missing and set it in the shell or process environment before starting the bridge.","If using a .env file, confirm it is actually loaded (dotenv or host app) and the variable name is spelled exactly as required.","Provision the relay credential (AI_SDK_ACP_HOST_TOOL_RELAY_CREDENTIAL) from your host/relay admin flow.","Verify with `printenv AI_SDK_ACP_HOST_TOOLS_FILE` (and the others) in the same environment that launches the process."],"exampleFix":"// before: bare launch\nnode bridge.mjs\n// after\nAI_SDK_ACP_HOST_TOOLS_FILE=./host-tools.json \\\nAI_SDK_ACP_HOST_TOOL_RELAY_URL=http://127.0.0.1:8787 \\\nAI_SDK_ACP_HOST_TOOL_RELAY_CREDENTIAL=$RELAY_TOKEN \\\nnode bridge.mjs","handlingStrategy":"validation","validationCode":"const REQUIRED = [\n  'AI_SDK_ACP_HOST_TOOLS_FILE',\n  'AI_SDK_ACP_HOST_TOOL_RELAY_URL',\n  'AI_SDK_ACP_HOST_TOOL_RELAY_CREDENTIAL',\n];\nfor (const name of REQUIRED) {\n  if (!process.env[name]) throw new Error(`Missing ${name}.`);\n}","typeGuard":null,"tryCatchPattern":"try {\n  await import('./bridge-entry.js');\n} catch (error) {\n  if (error instanceof Error && error.message.startsWith('Missing ')) {\n    console.error(`Configuration error: set ${error.message.slice('Missing '.length)} before starting the bridge.`);\n    process.exitCode = 1;\n  } else {\n    throw error;\n  }\n}","preventionTips":["Launch the bridge only from the host environment that provisions the variables, never manually.","Add a startup preflight script that checks all three variables and fails fast with a clear message.","Keep variable names in a single shared constant/module to avoid typos.","In CI/deploy, verify secrets (relay credential) are injected before the process starts."],"tags":["environment","config","startup","env-var"],"backgroundTag":"missing-env-var","analyzedSha":"69428b1f8b037e4d118fb4853428d5c4e620493c","analyzedAt":"2026-08-30T12:32:21.016Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}