paperclipai/paperclip · error
${existing.orgChainHealth?.repairGuidance ?? "Repair this ag
Error message
${existing.orgChainHealth?.repairGuidance ?? "Repair this agent's reporting chain before clearing its error"} What it means
Org-health conflict guard on POST /agents/:id/clear-error: the agent's error state stems from an invalid reporting chain, so clearing the error without repairing the chain would immediately recur; the route returns 409 with the agent-specific repair guidance.
Source
Thrown at server/src/routes/agents.ts:4523
}
if (actorAgent.role !== "ceo") {
res.status(403).json({ error: "Only CEO can manage permissions" });
return;
}
} else {
await assertBoardCanManageAgentsForCompany(req, existing.companyId);
}
const agent = await svc.updatePermissions(id, req.body);
if (!agent) {
res.status(404).json({ error: "Agent not found" });
return;
}
const effectiveCanAssignTasks =
agent.role === "ceo" || Boolean(agent.permissions?.canCreateAgents) || req.body.canAssignTasks;
await access.ensureMembership(agent.companyId, "agent", agent.id, "member", "active");
await access.setPrincipalPermission(
agent.companyId,
"agent",
agent.id,
"tasks:assign",
effectiveCanAssignTasks,
req.actor.type === "board" ? (req.actor.userId ?? null) : null,
);
const actor = getActorInfo(req);
await logActivity(db, {
companyId: agent.companyId,
actorType: actor.actorType,
actorId: actor.actorId,
agentId: actor.agentId,
runId: actor.runId,
agentApiKeyId: actor.agentApiKeyId,
action: "agent.permissions_updated",
entityType: "agent",View on GitHub (pinned to 01ad858492)
Solutions
- Repair the agent's reporting chain per the repair guidance, then clear its error.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at server/src/routes/agents.ts:3986 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of paperclipai/paperclip@01ad858492 (2026-08-18).
Data as JSON: /api/errors/4072485acdf27c65.
Report an issue: GitHub.