paperclipai/paperclip · error

Probe found no matching Anthropic Agent

Error message

Probe found no matching Anthropic Agent

What it means

resolveAgent finds a Paperclip-managed Anthropic Agent (by explicit agentId or by profile metadata). In probe mode it is forbidden to create resources, so when no matching agent exists it throws instead of POSTing /v1/agents. It signals that the remote managed agent has not been provisioned for this profile.

Source

Thrown at cli/src/commands/managed-agent.ts:294

      "GET",
      `/v1/agents/${encodeURIComponent(options.agentId)}`,
    );
    assertSafeManagedAgent(agent);
    assertManagedAgentModel(agent, options.model);
    return agent;
  }

  const existing = resourceByProfile(
    await listAll(key, "/v1/agents"),
    options.profileKey,
    "Agent",
  );
  if (existing) {
    assertSafeManagedAgent(existing);
    assertManagedAgentModel(existing, options.model);
    return existing;
  }
  if (options.probe) throw new Error("Probe found no matching Anthropic Agent");

  const agent = await anthropicRequest(key, "POST", "/v1/agents", {
    name: `Paperclip · ${options.displayName}`,
    description: "Versioned Paperclip remote agent; runnerd supplies session tools.",
    model: options.model,
    system: CLAUDE_MANAGED_SYSTEM_PROMPT,
    tools: [],
    mcp_servers: [],
    skills: [],
    metadata: { paperclip_profile: options.profileKey },
  });
  assertSafeManagedAgent(agent);
  assertManagedAgentModel(agent, options.model);
  return agent;
}

function assertManagedAgentModel(agent: Record<string, unknown>, expectedModel: string): void {
  const model = typeof agent.model === "string" ? agent.model : record(agent.model).id;

View on GitHub (pinned to 5716fe907e)

Solutions

  1. Run setup without --probe once to create the managed Agent.
  2. Pass the existing agent's ID explicitly via the agentId option.
  3. Verify the API key/workspace contains the agent (GET /v1/agents) and its metadata.paperclip_profile matches.
  4. If the agent was mutated externally, fix or recreate it in a non-probe run.

Example fix

// before (probe on unprovisioned profile)
cli managed-agent agent --probe
// after
cli managed-agent agent                # creates Agent + Environment
cli managed-agent agent --probe        # probe now succeeds
Defensive patterns

Strategy: validation

Validate before calling

// pre-check agent existence before a probe run
const agents = await listAll(key, "/v1/agents");
if (!resourceByProfile(agents, profileKey, "Agent")) {
  console.warn("No managed agent for profile; run setup without --probe first.");
}

Type guard

function isManagedAgent(a: unknown): a is { id: string; model: unknown; metadata?: { paperclip_profile?: string } } {
  return typeof a === "object" && a !== null && typeof (a as any).id === "string";
}

Try / catch

try {
  await resolveAgent(key, { ...opts, probe: true });
} catch (e) {
  if (e instanceof Error && e.message === "Probe found no matching Anthropic Agent") {
    // fall back to provisioning
    await setupManagedAgent({ ...opts, probe: false });
  } else throw e;
}

Prevention

When it happens

Trigger: Calling the `agent` (or `environment`) command with options.probe=true when no agentId is given and listAll(key, "/v1/agents") contains no entry whose paperclip_profile metadata equals options.profileKey.

Common situations: First-time setup with --probe; switched to a new Anthropic API key/workspace; agent renamed, archived, or its metadata.paperclip_profile edited outside Paperclip; agent deleted in the Anthropic console.

Related errors


AI-assisted analysis of paperclipai/paperclip@5716fe907e (2026-09-02). Data as JSON: /api/errors/33a09277b2ca76a6. Report an issue: GitHub.