MCPcopy Create free account
hub / github.com/TraderAlice/OpenAlice / onSessionDisposed

Method onSessionDisposed

src/workspaces/session-pool.ts:206–224  ·  view source on GitHub ↗
(wsId: string, recordId: string)

Source from the content-addressed store, hash-verified

204 // ── internals ────────────────────────────────────────────────────────────
205
206 private onSessionDisposed(wsId: string, recordId: string): void {
207 const session = this.sessions.get(recordId);
208 const adapter = this.adapterFor.get(recordId);
209 this.sessions.delete(recordId);
210 this.adapterFor.delete(recordId);
211 const ids = this.byWs.get(wsId);
212 if (ids) {
213 ids.delete(recordId);
214 if (ids.size === 0) this.byWs.delete(wsId);
215 }
216 if (this.transcriptWatcher && session) this.transcriptWatcher.unregister(session);
217 this.logger.info('pool.session_removed', {
218 wsId,
219 recordId,
220 agent: adapter?.id ?? 'unknown',
221 remaining: this.sessions.size,
222 forWorkspace: ids?.size ?? 0,
223 });
224 }
225}

Callers 1

spawnMethod · 0.95

Calls 4

infoMethod · 0.80
getMethod · 0.65
deleteMethod · 0.65
unregisterMethod · 0.65

Tested by

no test coverage detected