{"record":{"id":"2ff5789e987ede82","repo":"paperclipai/paperclip","slug":"profile-ctx-profilename-is-persona-ctx-prof","errorCode":null,"errorMessage":"Profile '${ctx.profileName}' is persona=${ctx.profile.persona}; use an agent profile or board prompt.","messagePattern":"Profile '(.+?)' is persona=(.+?); use an agent profile or board prompt\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/src/commands/client/prompt.ts","lineNumber":119,"sourceCode":"        try {\n          const result = await runBoardPrompt(opts.agent ?? \"\", promptParts.join(\" \"), opts);\n          printOutput(result, { json: opts.json });\n        } catch (err) {\n          handleCommandError(err);\n        }\n      }),\n    { includeCompany: false },\n  );\n}\n\nexport async function runAgentPrompt(\n  agentRef: string | undefined,\n  prompt: string,\n  opts: PromptOptions,\n): Promise<PromptResult> {\n  const ctx = resolveCommandContext(opts);\n  if (ctx.profile.persona && ctx.profile.persona !== \"agent\") {\n    throw new Error(`Profile '${ctx.profileName}' is persona=${ctx.profile.persona}; use an agent profile or board prompt.`);\n  }\n  const body = normalizePrompt(prompt);\n  const me = await ctx.api.get<Agent>(\"/api/agents/me\");\n  if (!me) throw new Error(\"Agent authentication failed\");\n  const expectedRef = agentRef?.trim() || ctx.profile.agentId || me.id;\n  assertAgentMatchesReference(me, expectedRef);\n\n  const result = await createOrCommentForAgent({\n    api: ctx.api,\n    actor: \"agent\",\n    agent: me,\n    companyId: me.companyId,\n    prompt: body,\n    issueId: opts.issue,\n    title: opts.title,\n    wake: opts.wake !== false,\n  });\n  return result;","sourceCodeStart":101,"sourceCodeEnd":137,"githubUrl":"https://github.com/paperclipai/paperclip/blob/67001ec6eb96ae601aa27bc91d9b2415d665334a/cli/src/commands/client/prompt.ts#L101-L137","documentation":"`runAgentPrompt` resolves the active CLI context profile and requires its `persona` to be `agent` (or unset). If the profile's persona is `board`, the function throws before issuing any API request, because an agent-prompt must run with agent credentials. The profile/persona come from `resolveCommandContext` -> `resolveProfile`, driven by `--profile` or the current context profile.","triggerScenarios":"Invoking `paperclipai agent prompt ...` or `agent-prompt ...` while the active profile was connected as a board operator (persona=board) via `paperclipai connect`. Also triggered by passing `--profile <boardProfileName>` to an agent-prompt command.","commonSituations":"Switching between a board profile and an agent profile and forgetting which persona the current profile carries; sharing a context file where the default profile is board; running agent automation in a shell whose current profile is the board operator.","solutions":["Switch to an agent profile: `paperclipai --profile <agentProfile> agent prompt ...`, or set the agent profile current via `paperclipai context set`","Reconfigure the profile persona to agent with `paperclipai connect` (choose the agent persona)","If you actually want to act as the board, use `paperclipai board prompt --agent <agentRef> ...` instead"],"exampleFix":"# before (current profile is a board profile)\npaperclipai agent prompt \"fix the bug\"\n# after\npaperclipai --profile my-agent agent prompt \"fix the bug\"","handlingStrategy":"validation","validationCode":"import { readContext, resolveProfile } from \"../../client/context.js\";\nfunction profileIsAgent(options: { context?: string; profile?: string }): boolean {\n  const { profile } = resolveProfile(readContext(options.context), options.profile);\n  return !profile.persona || profile.persona === \"agent\";\n}\nif (!profileIsAgent(opts)) {\n  throw new Error(\"Switch to an agent profile before running an agent prompt.\");\n}","typeGuard":"function isAgentProfile(profile: { persona?: string }): profile is { persona: \"agent\" } {\n  return profile.persona === \"agent\";\n}","tryCatchPattern":null,"preventionTips":["Check the current profile persona with `paperclipai context show` before agent commands","Use `--profile <name>` to be explicit about which profile runs","Keep board and agent profiles in separate context files to avoid cross-use"],"tags":["cli","profile","persona","auth","validation"],"backgroundTag":null,"analyzedSha":"67001ec6eb96ae601aa27bc91d9b2415d665334a","analyzedAt":"2026-08-12T12:05:45.408Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}