{"record":{"id":"04b11abd17293de0","repo":"paperclipai/paperclip","slug":"profile-name-is-required","errorCode":null,"errorMessage":"Profile name is required","messagePattern":"Profile name is required","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"cli/src/commands/client/connect.ts","lineNumber":184,"sourceCode":"  const selected = await p.select({\n    message: \"Connect as\",\n    options: [\n      { value: \"board\", label: \"Board operator\" },\n      { value: \"agent\", label: \"Agent in a company\" },\n    ],\n  });\n  assertNotCancelled(selected);\n  return selected as \"board\" | \"agent\";\n}\n\nasync function askProfileName(defaultName: string): Promise<string> {\n  const profile = await p.text({\n    message: \"Profile name\",\n    initialValue: defaultName || \"default\",\n  });\n  assertNotCancelled(profile);\n  const value = String(profile).trim();\n  if (!value) throw new Error(\"Profile name is required\");\n  return value;\n}\n\nasync function chooseCompany(\n  companies: Company[],\n  preferredCompanyId: string | undefined,\n  opts: { optional: boolean },\n): Promise<Company | null> {\n  if (companies.length === 0) {\n    if (opts.optional) return null;\n    throw new Error(\"No companies are accessible with this board credential.\");\n  }\n  const preferred = preferredCompanyId ? companies.find((company) => company.id === preferredCompanyId) : null;\n  if (companies.length === 1 && !opts.optional) return companies[0] ?? null;\n  const selected = await p.select({\n    message: opts.optional ? \"Default company for this profile\" : \"Agent company\",\n    initialValue: preferred?.id ?? companies[0]?.id,\n    options: [","sourceCodeStart":166,"sourceCodeEnd":202,"githubUrl":"https://github.com/paperclipai/paperclip/blob/67001ec6eb96ae601aa27bc91d9b2415d665334a/cli/src/commands/client/connect.ts#L166-L202","documentation":"Thrown by askProfileName when the interactive profile-name prompt yields an empty value after trimming. The CLI will not persist a profile with no name.","triggerScenarios":"User submits the @clack/prompts text prompt empty or with only whitespace during `paperclipai connect`.","commonSituations":"Accidental Enter at the prompt; paste of whitespace; terminal input glitch.","solutions":["Re-run connect and type a non-empty profile name.","Pre-set the profile name non-interactively if the command supports it (e.g., --profile)."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const name = String(await p.text({message: 'Profile name', initialValue: 'default'})).trim();\nif (!name) throw new Error('Profile name is required');","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Prefer non-interactive --profile when scripting.","Always provide a default value to the prompt."],"tags":["cli","connect","input-validation","interactive"],"backgroundTag":null,"analyzedSha":"67001ec6eb96ae601aa27bc91d9b2415d665334a","analyzedAt":"2026-08-12T12:05:45.408Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}