{"record":{"id":"637601def18f3642","repo":"paperclipai/paperclip","slug":"only-requesting-agent-can-resubmit-this-approval","errorCode":null,"errorMessage":"Only requesting agent can resubmit this approval","messagePattern":"Only requesting agent can resubmit this approval","errorType":"http","errorClass":null,"httpStatus":403,"severity":"error","filePath":"server/src/routes/approvals.ts","lineNumber":471,"sourceCode":"        actorId: req.actor.userId ?? \"board\",\n        action: \"approval.revision_requested\",\n        entityType: \"approval\",\n        entityId: approval.id,\n        details: { type: approval.type },\n      });\n\n      res.json(redactApprovalPayload(approval));\n    },\n  );\n\n  router.post(\"/approvals/:id/resubmit\", validate(resubmitApprovalSchema), async (req, res) => {\n    const id = req.params.id as string;\n    const existing = await getAccessibleResource(req, res, svc.getById(id), \"Approval not found\");\n    if (!existing) return;\n    if (!(await assertApprovalMutationAllowedByRunContext(req, res, existing.companyId))) return;\n\n    if (req.actor.type === \"agent\" && req.actor.agentId !== existing.requestedByAgentId) {\n      res.status(403).json({ error: \"Only requesting agent can resubmit this approval\" });\n      return;\n    }\n\n    const normalizedPayload = req.body.payload\n      ? existing.type === \"hire_agent\"\n        ? await secretsSvc.normalizeHireApprovalPayloadForPersistence(\n            existing.companyId,\n            req.body.payload,\n            { strictMode: strictSecretsMode },\n          )\n        : req.body.payload\n      : undefined;\n    const approval = await svc.resubmit(id, normalizedPayload);\n    const actor = getActorInfo(req);\n    await logActivity(db, {\n      companyId: approval.companyId,\n      actorType: actor.actorType,\n      actorId: actor.actorId,","sourceCodeStart":453,"sourceCodeEnd":489,"githubUrl":"https://github.com/paperclipai/paperclip/blob/5716fe907e596ce73501408fc6efdb19fb61edf2/server/src/routes/approvals.ts#L453-L489","documentation":"Error \"Only requesting agent can resubmit this approval\" thrown in paperclipai/paperclip.","triggerScenarios":"Thrown at server/src/routes/approvals.ts:473 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Resubmit the approval using the requesting agent's own credentials."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5716fe907e596ce73501408fc6efdb19fb61edf2","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}