fix(api): expose lastPlatformMessageId and importedAt in GET /api/v1/sessions/:id

Both fields are documented in chatlab-api.md but were missing from the
response. lastPlatformMessageId is used as the incremental import boundary.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
diguaandClaude Sonnet 4.6 committed 2026-06-25 21:45:16 +08:00
1 parent 419b3002c4
commit 2b0013f615
1 file changed
+3
@@ -17,6 +17,7 @@ import {
getMemberActivity,
getMessageTypeStats,
executeReadonlySql,
getLastPlatformMessageId,
} from '@openchatlab/core'
import { successResponse, errorResponse, sessionNotFound, exportTooLarge, sqlExecutionError, ApiError } from '../errors'
@@ -67,6 +68,8 @@ export function registerRestSessionRoutes(server: FastifyInstance, ctx: HttpRout
memberCount: info.memberCount,
firstTimestamp: info.firstMessageTs,
lastTimestamp: info.lastMessageTs,
lastPlatformMessageId: getLastPlatformMessageId(db),
importedAt: info.importedAt,
})
})