mirror of
https://github.com/deepseek-ai/deepseek-harness.git
synced 2026-09-12 04:01:20 +00:00
perf(session): separate indexed and snapshot log reads
This commit is contained in:
@@ -484,7 +484,7 @@ export class SessionCommandController {
|
||||
private async readSessionState(sessionId: SessionId): Promise<SessionReadState> {
|
||||
const attached = this.ctx.sessions.get(sessionId)
|
||||
if (attached !== undefined) {
|
||||
return { id: attached.id, header: attached.header, events: [...attached.events] }
|
||||
return { id: attached.id, header: attached.header, events: [...attached.snapshotEvents()] }
|
||||
}
|
||||
const inspected = await inspectApiSession(this.ctx, sessionId)
|
||||
return { id: inspected.meta.id, header: inspected.meta, events: inspected.events }
|
||||
|
||||
@@ -112,7 +112,7 @@ export class SessionHistoryController {
|
||||
// Constructor seed events have no session/event notification. Normally
|
||||
// only the end-seed suffix is new; if persistence advanced after the
|
||||
// opening observation, replay everything beyond that snapshot cursor.
|
||||
const suffix = session.events.slice(snapshotCursor === undefined
|
||||
const suffix = session.snapshotEvents(snapshotCursor === undefined
|
||||
? session.firstLiveSeq
|
||||
: snapshotCursor + 1)
|
||||
buffered.unshift(...suffix)
|
||||
|
||||
@@ -194,7 +194,7 @@ export class SessionController extends TypertRemoteService {
|
||||
): Promise<{ meta: SessionHeader; events: SessionEvent[] }> {
|
||||
const attached = this.ctx.sessions.get(sessionId)
|
||||
if (attached !== undefined) {
|
||||
return Promise.resolve({ meta: attached.header, events: [...attached.events] })
|
||||
return Promise.resolve({ meta: attached.header, events: [...attached.snapshotEvents()] })
|
||||
}
|
||||
return inspectApiSession(this.ctx, sessionId, signal)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user