{"record":{"id":"447dd4acf61303f1","repo":"alibaba/nacos","slug":"transport-must-contain-1-to-64-letters-digits","errorCode":null,"errorMessage":"transport must contain 1 to 64 letters, digits, +, or -","messagePattern":"transport must contain 1 to 64 letters, digits, \\+, or -","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"console-ui/src/pages/AI/agent-console-model.js","lineNumber":88,"sourceCode":"  const withoutTrailingCommas = value.replace(\n    /(\"(?:\\\\.|[^\"\\\\])*\")|,\\s*([}\\]])/g,\n    (match, quoted, closing) => quoted || closing || match\n  );\n  return parseJson(withoutTrailingCommas, 'agentCard');\n}\n\nfunction isObject(value) {\n  return value !== null && !Array.isArray(value) && typeof value === 'object';\n}\n\nfunction optionalString(value) {\n  return typeof value === 'string' && value.trim() ? value.trim() : undefined;\n}\n\nfunction validateTransport(value) {\n  const transport = required(value, 'transport');\n  if (!/^[0-9A-Za-z+-]{1,64}$/.test(transport)) {\n    throw new Error('transport must contain 1 to 64 letters, digits, +, or -');\n  }\n  return transport;\n}\n\nfunction endpointKey(uri, transport) {\n  let parsed;\n  try {\n    parsed = new URL(uri);\n  } catch (e) {\n    throw new Error(`Invalid Endpoint URI: ${uri}`);\n  }\n  if (!parsed.protocol || !parsed.hostname || parsed.username || parsed.password || parsed.hash) {\n    throw new Error(`Invalid Endpoint URI: ${uri}`);\n  }\n  let { port } = parsed;\n  if (!port) {\n    if (parsed.protocol === 'http:' || parsed.protocol === 'ws:') {\n      port = '80';","sourceCodeStart":70,"sourceCodeEnd":106,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/console-ui/src/pages/AI/agent-console-model.js#L70-L106","documentation":"Thrown by validateTransport() in agent-console-model when the transport/protocol-binding string does not match the regex ^[0-9A-Za-z+-]{1,64}$. Transport identifiers must be 1-64 characters of letters, digits, '+', or '-' only. This validates the A2A protocolBinding (or legacy transport) field on each agent interface.","triggerScenarios":"Entering a transport value containing spaces, underscores, slashes, parentheses, or leaving it longer than 64 characters. Examples that fail: 'HTTP JSON', 'grpc_v2', 'HTTP/1.1', a value with unicode.","commonSituations":"User types a human-readable protocol label instead of the machine token, or pastes a URL or free text into the transport field.","solutions":["Use a compact token like 'HTTP', 'GRPC', 'HTTP+JSON', or 'A2A'.","Remove spaces, underscores, slashes, and special characters; keep only letters, digits, '+', '-'.","Ensure the value is between 1 and 64 characters."],"exampleFix":"// before\ntransport = 'HTTP JSON';\n\n// after\ntransport = 'HTTP+JSON';","handlingStrategy":"validation","validationCode":"function isValidTransport(v) {\n  return typeof v === 'string' && /^[0-9A-Za-z+-]{1,64}$/.test(v);\n}","typeGuard":"function isValidTransport(v) {\n  return typeof v === 'string' && /^[0-9A-Za-z+-]{1,64}$/.test(v);\n}","tryCatchPattern":"try {\n  validateTransport(value);\n} catch (e) {\n  Message.error(e.message); // 'transport must contain 1 to 64 letters, digits, +, or -'\n  return;\n}","preventionTips":["Offer a dropdown of known transports (HTTP, GRPC, HTTP+JSON) with an editable-but-constrained input.","Validate transport live against the regex.","Document allowed characters next to the field."],"tags":["validation","agent","transport","regex","frontend"],"backgroundTag":null,"analyzedSha":"9b989acdf181d00898f2e8839257bb2b2a3cefe3","analyzedAt":"2026-08-14T07:17:31.569Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}