{"record":{"id":"6e37b2795fa46103","repo":"paperclipai/paperclip","slug":"session-not-found-params-sessionid","errorCode":null,"errorMessage":"Session not found: ${params.sessionId}","messagePattern":"Session not found: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/src/services/plugin-host-services.ts","lineNumber":3296,"sourceCode":"          throw new Error(\"Host services have been disposed\");\n        }\n\n        const companyId = ensureCompanyId(params.companyId);\n        await ensurePluginAvailableForCompany(companyId);\n\n        // Verify session exists and belongs to this plugin\n        const session = await db\n          .select()\n          .from(agentTaskSessionsTable)\n          .where(\n            and(\n              eq(agentTaskSessionsTable.id, params.sessionId),\n              eq(agentTaskSessionsTable.companyId, companyId),\n              like(agentTaskSessionsTable.taskKey, `plugin:${pluginKey}:session:%`),\n            ),\n          )\n          .then((rows) => rows[0] ?? null);\n        if (!session) throw new Error(`Session not found: ${params.sessionId}`);\n\n        const run = await heartbeat.wakeup(session.agentId, {\n          source: \"automation\",\n          triggerDetail: \"system\",\n          reason: params.reason ?? null,\n          payload: { prompt: params.prompt },\n          contextSnapshot: {\n            taskKey: session.taskKey,\n            wakeReason: params.reason ?? null,\n            wakeSource: \"automation\",\n            wakeTriggerDetail: \"system\",\n            paperclipAgentMessage: {\n              text: params.prompt,\n              source: \"plugin_session\",\n              pluginKey,\n              sessionId: params.sessionId,\n            },\n          },","sourceCodeStart":3278,"sourceCodeEnd":3314,"githubUrl":"https://github.com/paperclipai/paperclip/blob/a7e689b3c35347b529cb9f54c9b9a8575a3dcab6/server/src/services/plugin-host-services.ts#L3278-L3314","documentation":"sendMessage could not find an agent task session with the given sessionId owned by this plugin (taskKey pattern plugin:<pluginKey>:session:%). The session id is wrong, expired, or belongs to another plugin.","triggerScenarios":"Thrown at server/src/services/plugin-host-services.ts:3287 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Confirm the sessionId exists; sessions may expire. List active sessions and use a current ID."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a7e689b3c35347b529cb9f54c9b9a8575a3dcab6","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}