{"record":{"id":"33acfa43b727ab0a","repo":"paperclipai/paperclip","slug":"invalid-persona-value-use-board-or-agent","errorCode":null,"errorMessage":"Invalid --persona value. Use board or agent.","messagePattern":"Invalid --persona value\\. Use board or agent\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/src/commands/client/context.ts","lineNumber":157,"sourceCode":"    patch[key] = value;\n  }\n}\n\nfunction buildContextPatch(opts: ContextSetOptions): Partial<ClientContextProfile> {\n  const patch: Partial<ClientContextProfile> = {};\n  setIfProvided(patch, \"apiBase\", opts.apiBase);\n  setIfProvided(patch, \"companyId\", opts.companyId);\n  setIfProvided(patch, \"persona\", parsePersona(opts.persona));\n  setIfProvided(patch, \"agentId\", opts.agentId);\n  setIfProvided(patch, \"agentName\", opts.agentName);\n  setIfProvided(patch, \"apiKeyEnvVarName\", opts.apiKeyEnvVarName);\n  return patch;\n}\n\nfunction parsePersona(value: string | undefined): \"board\" | \"agent\" | undefined {\n  if (value === undefined) return undefined;\n  if (value === \"board\" || value === \"agent\") return value;\n  throw new Error(\"Invalid --persona value. Use board or agent.\");\n}\n","sourceCodeStart":139,"sourceCodeEnd":159,"githubUrl":"https://github.com/paperclipai/paperclip/blob/67001ec6eb96ae601aa27bc91d9b2415d665334a/cli/src/commands/client/context.ts#L139-L159","documentation":"parsePersona validates the --persona flag and rejects any value that is not exactly \"board\" or \"agent\". The persona determines whether the profile behaves as a board operator or an agent.","triggerScenarios":"Running `paperclipai context set --persona admin` (or any value other than board/agent).","commonSituations":"Typo; using singular forms like \"user\"; following outdated docs that list other personas.","solutions":["Pass --persona board or --persona agent.","Omit --persona to leave it unchanged."],"exampleFix":"// before\npaperclipai context set --persona operator\n// after\npaperclipai context set --persona board","handlingStrategy":"validation","validationCode":"const PERSONAS = new Set(['board', 'agent']);\nfunction parsePersona(value: string | undefined) {\n  if (value === undefined) return undefined;\n  if (!PERSONAS.has(value)) throw new Error('Invalid --persona value. Use board or agent.');\n  return value as 'board' | 'agent';\n}","typeGuard":"const isPersona = (v: string): v is 'board' | 'agent' => v === 'board' || v === 'agent';","tryCatchPattern":null,"preventionTips":["Restrict --persona to a CLI choices array so invalid values are rejected at parse time.","Document the two valid personas prominently."],"tags":["cli","context","input-validation","persona"],"backgroundTag":null,"analyzedSha":"67001ec6eb96ae601aa27bc91d9b2415d665334a","analyzedAt":"2026-08-12T12:05:45.408Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}