perf(session): reuse immutable event snapshots

This commit is contained in:
_Kerman
2026-08-28 13:43:16 +08:00
parent 5660f44d29
commit bcfec8d1c3
43 changed files with 116 additions and 116 deletions
+2 -2
View File
@@ -191,10 +191,10 @@ export class SessionController extends TypertRemoteService {
inspect(
sessionId: SessionId,
signal?: AbortSignal,
): Promise<{ meta: SessionHeader; events: SessionEvent[] }> {
): Promise<{ meta: SessionHeader; events: readonly SessionEvent[] }> {
const attached = this.ctx.sessions.get(sessionId)
if (attached !== undefined) {
return Promise.resolve({ meta: attached.header, events: [...attached.snapshotEvents()] })
return Promise.resolve({ meta: attached.header, events: attached.snapshotEvents() })
}
return inspectApiSession(this.ctx, sessionId, signal)
}