{"record":{"id":"a7ef29192e686dcd","repo":"paperclipai/paperclip","slug":"existing-orgchainhealth-repairguidance-repa","errorCode":null,"errorMessage":"${existing.orgChainHealth?.repairGuidance ?? \"Repair this agent's reporting chain before resuming it\"}","messagePattern":"\\$\\{existing\\.orgChainHealth\\?\\.repairGuidance \\?\\? \"Repair this agent's reporting chain before resuming it\"\\}","errorType":"http","errorClass":null,"httpStatus":409,"severity":"error","filePath":"server/src/routes/agents.ts","lineNumber":4210,"sourceCode":"\n  router.get(\"/agents/:id\", async (req, res) => {\n    const id = req.params.id as string;\n    const agent = await getAccessibleResource(req, res, svc.getById(id), \"Agent not found\");\n    if (!agent) return;\n    if (!(await assertAgentReadAllowed(req, res, agent))) return;\n    const isSelf = req.actor.type === \"agent\" && req.actor.agentId === id;\n    if (isSelf) {\n      const trustPreset = await resolveAgentSelfTrustPreset(req, agent);\n      if (trustPreset.kind === \"denied\") {\n        res.status(403).json({ error: trustPreset.detail });\n        return;\n      }\n      if (trustPreset.kind === \"low_trust_review\") {\n        res.json(buildLowTrustSelfView(agent));\n        return;\n      }\n    }\n    const canReadSensitiveDetail = isSelf\n      ? true\n      : await actorCanReadConfigurationsForCompany(req, agent.companyId);\n    if (!canReadSensitiveDetail) {\n      res.json(await buildAgentDetail(agent, { restricted: true }));\n      return;\n    }\n    res.json(await buildAgentDetail(agent));\n  });\n\n  router.get(\"/agents/:id/configuration\", async (req, res) => {\n    const id = req.params.id as string;\n    const agent = await svc.getById(id);\n    if (!agent) {\n      res.status(404).json({ error: \"Agent not found\" });\n      return;\n    }\n    await assertCanReadConfigurations(req, agent.companyId);\n    res.json(redactAgentConfiguration(agent));","sourceCodeStart":4192,"sourceCodeEnd":4228,"githubUrl":"https://github.com/paperclipai/paperclip/blob/3f1d897a7c018d76563a21c6e39c3c9b03933622/server/src/routes/agents.ts#L4192-L4228","documentation":"Org-health conflict guard on POST /agents/:id/resume: the agent's reporting chain is currently invalid (orgChainHealth status 'invalid_org_chain' — e.g. its manager no longer exists), so resuming is blocked with 409 and the agent-specific repair guidance text is returned.","triggerScenarios":"Thrown at server/src/routes/agents.ts:3955 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Repair the agent's reporting chain per the repair guidance, then resume the agent."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3f1d897a7c018d76563a21c6e39c3c9b03933622","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}