{"record":{"id":"a6160cfadd08eca0","repo":"paperclipai/paperclip","slug":"revision-not-found","errorCode":null,"errorMessage":"Revision not found","messagePattern":"Revision not found","errorType":"http","errorClass":null,"httpStatus":404,"severity":"error","filePath":"server/src/routes/agents.ts","lineNumber":3478,"sourceCode":"\n      const owner = await readOwnerLoginSession(companyId, type, sessionId, ownerUserId);\n      if (!owner) {\n        res.status(404).json({ error: \"Adapter login session not found\" });\n        return;\n      }\n      res.json(owner);\n    },\n  );\n\n  // Cancel a login session. The owner aborts the in-flight run. A non-owner or a\n  // cross-company caller receives a 404.\n  router.post(\n    \"/companies/:companyId/adapters/:type/login-sessions/:sessionId/cancel\",\n    async (req, res) => {\n      const companyId = req.params.companyId as string;\n      const type = req.params.type as string;\n      const sessionId = req.params.sessionId as string;\n      const ownerUserId = await assertCanManageAdapterLogin(req, companyId);\n      assertDeviceLoginAdapter(type);\n\n      // Scope the cancel to this company, adapter, and owner. A non-owner and a\n      // cross-company caller both receive a 404 and cannot cancel a session.\n      const owner = await readOwnerLoginSession(companyId, type, sessionId, ownerUserId);\n      if (!owner) {\n        res.status(404).json({ error: \"Adapter login session not found\" });\n        return;\n      }\n      // Durably release the company slot. The durable write terminates the row\n      // even when this process does not own the in-flight run, so a cross-process\n      // cancel or a cancel after a restart does not leave the slot held until the\n      // expiry. The reaper deletes the sandbox and finalizes the terminal.\n      const cancelled = await adapterLoginService.cancelOwnerSession(sessionId, companyId, ownerUserId);\n      // Abort the in-flight run this process owns, so the local login stops at\n      // once instead of waiting for the reaper. A run in another process, or an\n      // already-terminal run, has no controller here.\n      adapterLoginAbortControllers.get(sessionId)?.abort();","sourceCodeStart":3460,"sourceCodeEnd":3496,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/server/src/routes/agents.ts#L3460-L3496","documentation":"Lookup guard on the config-revision detail route: the requested revisionId does not match any stored configuration revision for this agent, so the route returns 404 after the agent itself was found and access checked.","triggerScenarios":"Thrown at server/src/routes/agents.ts:3024 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the revision id exists for this agent; list revisions and use a valid one."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01ad8584922b5d85292b1723cae71fa0d9b07a19","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}