fix: normalize SDK response shape in readMessagesFromSDK

Use response.data ?? response to handle both object and array-shaped
SDK responses, consistent with all other SDK readers.
This commit is contained in:
YeonGyu-Kim 2026-02-16 16:02:25 +09:00
parent 9889ac0dd9
commit c1681ef9ec

View File

@ -62,7 +62,7 @@ export async function readMessagesFromSDK(
): Promise<StoredMessageMeta[]> {
try {
const response = await client.session.messages({ path: { id: sessionID } })
const data: unknown = response.data
const data: unknown = response.data ?? response
if (!Array.isArray(data)) return []
const messages = data