{"record":{"id":"0583299989999aca","repo":"paperclipai/paperclip","slug":"adapter-login-session-not-found","errorCode":null,"errorMessage":"Adapter login session not found","messagePattern":"Adapter login session not found","errorType":"http","errorClass":null,"httpStatus":404,"severity":"error","filePath":"server/src/routes/agents.ts","lineNumber":2974,"sourceCode":"      afterConfig: redactRevisionSnapshot(revision.afterConfig),\n    };\n  }\n\n  function toLeanOrgNode(node: Record<string, unknown>): Record<string, unknown> {\n    const reports = Array.isArray(node.reports)\n      ? (node.reports as Array<Record<string, unknown>>).map((report) => toLeanOrgNode(report))\n      : [];\n    return {\n      id: String(node.id),\n      name: String(node.name),\n      role: String(node.role),\n      status: String(node.status),\n      reports,\n    };\n  }\n\n  router.param(\"id\", async (req, _res, next, rawId) => {\n    try {\n      req.params.id = await normalizeAgentReference(req, String(rawId));\n      next();\n    } catch (err) {\n      next(err);\n    }\n  });\n\n  router.get(\"/companies/:companyId/adapters/:type/models\", async (req, res) => {\n    const companyId = req.params.companyId as string;\n    assertCompanyAccess(req, companyId);\n    const type = assertKnownAdapterType(req.params.type as string);\n    const refresh = typeof req.query.refresh === \"string\"\n      ? [\"1\", \"true\", \"yes\"].includes(req.query.refresh.toLowerCase())\n      : false;\n    const environmentId = asNonEmptyString(req.query.environmentId);\n    const environment = environmentId ? await environmentsSvc.getById(environmentId) : null;\n    if (environmentId && !environment) {\n      res.status(404).json({ error: \"Environment not found\" });","sourceCodeStart":2956,"sourceCodeEnd":2992,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/server/src/routes/agents.ts#L2956-L2992","documentation":"Not-found equivalence guard on the adapter login-session read route: the requested login session does not exist, expired, or belongs to another user/company. All these cases intentionally return the same 404 so the endpoint does not act as a session-existence oracle.","triggerScenarios":"Thrown at server/src/routes/agents.ts:2563 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Start a new adapter login session; the previous one expired or never existed."],"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"}