{"record":{"id":"b5d2427ba135f43d","repo":"paperclipai/paperclip","slug":"approval-request-failed","errorCode":null,"errorMessage":"Approval request failed.","messagePattern":"Approval request failed\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/src/commands/client/teams.ts","lineNumber":425,"sourceCode":"        `A Paperclip CLI agent-run attempted to install catalog team \"${trimmedRef}\" into company \"${ctx.companyId}\", ` +\n        `but the API denied the install with: ${error.message}.`,\n      recommendedAction:\n        \"Approve the catalog team source and rerun the install with a board or agent-creator token, or grant agents:create to the requesting agent and rerun the same command.\",\n      risks: [\n        \"Catalog team installation can create agents, projects, tasks, routines, skills, and secret bindings.\",\n        \"Only approve after checking the catalog source, selected files, target manager, and collision strategy.\",\n      ],\n      installAttempt: {\n        companyId: ctx.companyId,\n        catalogRef: trimmedRef,\n        options: approvalInstallOptions,\n        deniedReason: error.message,\n      },\n    },\n  };\n  const approval = await ctx.api.post<Approval>(apiPath`/api/companies/${ctx.companyId}/approvals`, payload);\n  if (!approval) {\n    throw new Error(\"Approval request failed.\");\n  }\n  return {\n    status: \"approval_requested\",\n    approval,\n    installAttempt: {\n      companyId: ctx.companyId,\n      catalogRef: trimmedRef,\n      options: returnedInstallOptions,\n      deniedReason: error.message,\n    },\n  };\n}\n\nfunction omitInstallSecretValues(options: CatalogTeamInstallOptions): CatalogTeamInstallOptions {\n  if (!options.secretValues) return options;\n  const { secretValues: _secretValues, ...safeOptions } = options;\n  return safeOptions;\n}","sourceCodeStart":407,"sourceCodeEnd":443,"githubUrl":"https://github.com/paperclipai/paperclip/blob/120ae5428fa29bee300bcf806491cd4d965fbb7c/cli/src/commands/client/teams.ts#L407-L443","documentation":"requestInstallApproval's fallback path to create an approval request itself failed, so neither the team install nor the approval escalation could complete; a guard on the approval-creation call.","triggerScenarios":"Thrown at cli/src/commands/client/teams.ts:425 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check server reachability and credentials, then retry the approval request."],"exampleFix":null,"handlingStrategy":"try-catch","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"}