fix(session): remove unreachable listing branch

This commit is contained in:
_Kerman committed 2026-08-21 22:08:53 +08:00
1 parent 7e3d5332dc
commit 95ed302c9c
2 files changed
+2 -4

No files matched your search

@@ -397,7 +397,7 @@ export function scanLog(buffer: Buffer): SessionLogScan {
* @param firstLine - first JSONL record without its newline.
* @returns normalized logical header JSON, or `undefined` for invalid framing.
*/
export function parseStoredHeaderMeta(firstLine: string): unknown {
export function parseStoredHeaderMeta(firstLine: string): Record<string, unknown> | undefined {
let parsed: unknown
try {
parsed = JSON.parse(firstLine)
@@ -605,9 +605,7 @@ export class JsonlSessionPersistence extends SessionPersistence implements Persi
if (first === undefined) continue // empty/half-written file
const rawMeta = parseStoredHeaderMeta(first)
if (rawMeta === undefined) continue // not a session header
const rawId = typeof rawMeta === 'object' && rawMeta !== null
? (rawMeta as Record<string, unknown>)['id']
: undefined
const rawId = rawMeta['id']
const expectedId = typeof rawId === 'string'
? SessionId(rawId)
: SessionId('')