{"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":null,"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/120ae5428fa29bee300bcf806491cd4d965fbb7c/cli/src/commands/client/prompt.ts#L101-L137","documentation":"runAgentPrompt checks the active CLI profile persona; a board (or other non-agent) profile cannot use the agent prompt path because /api/agents/me requires an agent credential.","triggerScenarios":"Thrown at cli/src/commands/client/prompt.ts:119 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use an agent-persona profile, or run the board prompt variant of the command."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"120ae5428fa29bee300bcf806491cd4d965fbb7c","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}