MCPcopy Create free account
hub / github.com/MagicCube/agentara / removeSession

Method removeSession

src/kernel/sessioning/session-manager.ts:252–262  ·  view source on GitHub ↗

* Removes a session: deletes the database record and the associated JSONL file. * @param sessionId - The session identifier. * @throws SessionNotFoundError if the session does not exist.

(sessionId: string)

Source from the content-addressed store, hash-verified

250 * @throws SessionNotFoundError if the session does not exist.
251 */
252 removeSession(sessionId: string): void {
253 if (!this.existsSession(sessionId)) {
254 throw new SessionNotFoundError(sessionId);
255 }
256 this._db.delete(sessions).where(eq(sessions.id, sessionId)).run();
257 const filePath = config.paths.resolveSessionFilePath(sessionId);
258 if (existsSync(filePath)) {
259 unlinkSync(filePath);
260 }
261 this._logger.info(`Removed session: ${sessionId}`);
262 }
263
264 /**
265 * Updates the `last_message_created_at` and `updated_at` timestamps for a session.

Callers 2

sessions.tsFile · 0.80
handoff.tsFile · 0.80

Calls 2

existsSessionMethod · 0.95
runMethod · 0.80

Tested by

no test coverage detected