paperclipai/paperclip · error

Session not found: ${params.sessionId}

Error message

Session not found: ${params.sessionId}

What it means

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.

Source

Thrown at server/src/services/plugin-host-services.ts:3296

          throw new Error("Host services have been disposed");
        }

        const companyId = ensureCompanyId(params.companyId);
        await ensurePluginAvailableForCompany(companyId);

        // Verify session exists and belongs to this plugin
        const session = await db
          .select()
          .from(agentTaskSessionsTable)
          .where(
            and(
              eq(agentTaskSessionsTable.id, params.sessionId),
              eq(agentTaskSessionsTable.companyId, companyId),
              like(agentTaskSessionsTable.taskKey, `plugin:${pluginKey}:session:%`),
            ),
          )
          .then((rows) => rows[0] ?? null);
        if (!session) throw new Error(`Session not found: ${params.sessionId}`);

        const run = await heartbeat.wakeup(session.agentId, {
          source: "automation",
          triggerDetail: "system",
          reason: params.reason ?? null,
          payload: { prompt: params.prompt },
          contextSnapshot: {
            taskKey: session.taskKey,
            wakeReason: params.reason ?? null,
            wakeSource: "automation",
            wakeTriggerDetail: "system",
            paperclipAgentMessage: {
              text: params.prompt,
              source: "plugin_session",
              pluginKey,
              sessionId: params.sessionId,
            },
          },

View on GitHub (pinned to a7e689b3c3)

Solutions

  1. Confirm the sessionId exists; sessions may expire. List active sessions and use a current ID.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at server/src/services/plugin-host-services.ts:3287 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of paperclipai/paperclip@a7e689b3c3 (2026-08-18). Data as JSON: /api/errors/6e37b2795fa46103. Report an issue: GitHub.