paperclipai/paperclip · error · Error

Profile '${ctx.profileName}' is persona=${ctx.profile.person

Error message

Profile '${ctx.profileName}' is persona=${ctx.profile.persona}; use an agent profile or board prompt.

What it means

`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.

Source

Thrown at cli/src/commands/client/prompt.ts:119

        try {
          const result = await runBoardPrompt(opts.agent ?? "", promptParts.join(" "), opts);
          printOutput(result, { json: opts.json });
        } catch (err) {
          handleCommandError(err);
        }
      }),
    { includeCompany: false },
  );
}

export async function runAgentPrompt(
  agentRef: string | undefined,
  prompt: string,
  opts: PromptOptions,
): Promise<PromptResult> {
  const ctx = resolveCommandContext(opts);
  if (ctx.profile.persona && ctx.profile.persona !== "agent") {
    throw new Error(`Profile '${ctx.profileName}' is persona=${ctx.profile.persona}; use an agent profile or board prompt.`);
  }
  const body = normalizePrompt(prompt);
  const me = await ctx.api.get<Agent>("/api/agents/me");
  if (!me) throw new Error("Agent authentication failed");
  const expectedRef = agentRef?.trim() || ctx.profile.agentId || me.id;
  assertAgentMatchesReference(me, expectedRef);

  const result = await createOrCommentForAgent({
    api: ctx.api,
    actor: "agent",
    agent: me,
    companyId: me.companyId,
    prompt: body,
    issueId: opts.issue,
    title: opts.title,
    wake: opts.wake !== false,
  });
  return result;

View on GitHub (pinned to 67001ec6eb)

Solutions

  1. Switch to an agent profile: `paperclipai --profile <agentProfile> agent prompt ...`, or set the agent profile current via `paperclipai context set`
  2. Reconfigure the profile persona to agent with `paperclipai connect` (choose the agent persona)
  3. If you actually want to act as the board, use `paperclipai board prompt --agent <agentRef> ...` instead

Example fix

# before (current profile is a board profile)
paperclipai agent prompt "fix the bug"
# after
paperclipai --profile my-agent agent prompt "fix the bug"
Defensive patterns

Strategy: validation

Validate before calling

import { readContext, resolveProfile } from "../../client/context.js";
function profileIsAgent(options: { context?: string; profile?: string }): boolean {
  const { profile } = resolveProfile(readContext(options.context), options.profile);
  return !profile.persona || profile.persona === "agent";
}
if (!profileIsAgent(opts)) {
  throw new Error("Switch to an agent profile before running an agent prompt.");
}

Type guard

function isAgentProfile(profile: { persona?: string }): profile is { persona: "agent" } {
  return profile.persona === "agent";
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of paperclipai/paperclip@67001ec6eb (2026-08-12). Data as JSON: /api/errors/2ff5789e987ede82. Report an issue: GitHub.