{"record":{"id":"e0f6040672a63c67","repo":"paperclipai/paperclip","slug":"test-run-template-not-found","errorCode":null,"errorMessage":"Test run template not found","messagePattern":"Test run template not found","errorType":"http","errorClass":null,"httpStatus":404,"severity":"error","filePath":"server/src/routes/company-skills.ts","lineNumber":510,"sourceCode":"        action: \"company.skill_test_run_template_created\",\n        entityType: \"company_skill_test_run_template\",\n        entityId: result.id,\n        details: { name: result.name },\n      });\n      res.status(201).json(result);\n    },\n  );\n\n  router.patch(\n    \"/companies/:companyId/skill-test-run-templates/:templateId\",\n    validate(companySkillTestRunTemplateUpdateSchema),\n    async (req, res) => {\n      const companyId = req.params.companyId as string;\n      const templateId = req.params.templateId as string;\n      await assertCanMutateCompanySkills(req, companyId, \"skills.edit\");\n      const result = await svc.updateTestRunTemplate(companyId, templateId, req.body, skillActor(req));\n      if (!result) {\n        res.status(404).json({ error: \"Test run template not found\" });\n        return;\n      }\n      const actor = getActorInfo(req);\n      await logActivity(db, {\n        companyId,\n        actorType: actor.actorType,\n        actorId: actor.actorId,\n        agentId: actor.agentId,\n        runId: actor.runId,\n        agentApiKeyId: actor.agentApiKeyId,\n        action: \"company.skill_test_run_template_updated\",\n        entityType: \"company_skill_test_run_template\",\n        entityId: result.id,\n        details: { changedKeys: Object.keys(req.body).sort() },\n      });\n      res.json(result);\n    },\n  );","sourceCodeStart":492,"sourceCodeEnd":528,"githubUrl":"https://github.com/paperclipai/paperclip/blob/120ae5428fa29bee300bcf806491cd4d965fbb7c/server/src/routes/company-skills.ts#L492-L528","documentation":"Error \"Test run template not found\" thrown in paperclipai/paperclip.","triggerScenarios":"Thrown at server/src/routes/company-skills.ts:510 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the id in the request path or body refers to an existing record in this company; re-list the parent collection to get a valid id.","Check that the record was not deleted or archived, and that the request is scoped to the correct companyId."],"exampleFix":null,"handlingStrategy":null,"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-14T05:17:10.506Z"}