{"record":{"id":"40f55298ab9deacf","repo":"earendil-works/pi","slug":"not-found-40f552","errorCode":"not_found","errorMessage":"Session is not live: ${sessionId}","messagePattern":"Session is not live: (.+?)","errorType":"error_code","errorClass":"PiServerError","httpStatus":null,"severity":"error","filePath":"packages/server/src/sessions.ts","lineNumber":315,"sourceCode":"\t\treturn snapshot;\n\t}\n\n\tprivate async attach(connection: ConnectionState, live: LiveSession): Promise<void> {\n\t\tif (connection.disconnected || connection.stage !== \"ready\" || connection.connection.closed) {\n\t\t\tawait this.maybeDispose(live);\n\t\t\tthrow new PiServerError(\"invalid_request\", \"Connection closed while attaching to a session\");\n\t\t}\n\t\tconnection.sessionIds.add(live.id);\n\t\tlive.connections.add(connection);\n\t}\n\n\tprivate requireAttached(connection: ConnectionState, sessionId: string): LiveSession {\n\t\tif (!connection.sessionIds.has(sessionId)) {\n\t\t\tthrow new PiServerError(\"invalid_request\", `Connection is not attached to session ${sessionId}`);\n\t\t}\n\t\tconst live = this.liveSessions.get(sessionId);\n\t\tif (!live || live.terminal || live.disposing) {\n\t\t\tthrow new PiServerError(\"not_found\", `Session is not live: ${sessionId}`);\n\t\t}\n\t\treturn live;\n\t}\n\n\tprivate scheduleMaybeDispose(live: LiveSession): void {\n\t\tvoid this.maybeDispose(live).catch((error: unknown) => this.options.reportError(error));\n\t}\n\n\tprivate async maybeDispose(live: LiveSession): Promise<void> {\n\t\tif (\n\t\t\tthis.options.isClosing() ||\n\t\t\t!live.ready ||\n\t\t\tlive.disposing ||\n\t\t\tlive.connections.size > 0 ||\n\t\t\tlive.operationCount > 0 ||\n\t\t\t(!live.terminal && live.runtime.getPhase() !== \"idle\")\n\t\t) {\n\t\t\treturn live.disposing;","sourceCodeStart":297,"sourceCodeEnd":333,"githubUrl":"https://github.com/earendil-works/pi/blob/4af9d21d3b4d664e4a29fcabfec85171077248e3/packages/server/src/sessions.ts#L297-L333","documentation":"Error \"Session is not live: ${sessionId}\" thrown in earendil-works/pi.","triggerScenarios":"Thrown at packages/server/src/sessions.ts:315 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["The session is closed; open or recreate the session before prompting."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4af9d21d3b4d664e4a29fcabfec85171077248e3","analyzedAt":"2026-08-24T13:07:14.692Z","schemaVersion":2},"datasetVersion":"2026-08-24T17:17:21.512Z"}