fix(core): populate restoredAt from metadata in metadataToSession

The session reconstruction path (readMetadataRaw → metadataToSession)
was not mapping the restoredAt field, so session.restoredAt was always
undefined after a server restart despite the value existing in the
metadata file.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
suraj-markup 2026-03-01 18:59:33 +05:30
parent 1f062201fb
commit eaf18015af
1 changed files with 1 additions and 0 deletions

View File

@ -152,6 +152,7 @@ function metadataToSession(
agentInfo: meta["summary"] ? { summary: meta["summary"], agentSessionId: null } : null,
createdAt: meta["createdAt"] ? new Date(meta["createdAt"]) : (createdAt ?? new Date()),
lastActivityAt: modifiedAt ?? new Date(),
restoredAt: meta["restoredAt"] ? new Date(meta["restoredAt"]) : undefined,
metadata: meta,
};
}