Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/providers/cursor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,8 @@ const USER_MESSAGES_QUERY = `
// the whole template. The original combined string is preserved as
// BUBBLE_QUERY_SINCE for any caller that doesn't want the cap.
const BUBBLE_QUERY_SINCE_HEAD = BUBBLE_QUERY_BASE + `
AND (json_extract(value, '$.createdAt') > ? OR json_extract(value, '$.createdAt') IS NULL)`
AND json_extract(value, '$.createdAt') IS NOT NULL
AND json_extract(value, '$.createdAt') > ?`
const BUBBLE_QUERY_SINCE_TAIL = `
ORDER BY ROWID ASC
`
Expand Down Expand Up @@ -458,6 +459,7 @@ function parseBubbles(db: SqliteDatabase, seenKeys: Set<string>): { calls: Parse
}

const createdAt = row.created_at ?? ''
if (!createdAt) continue
// The JSON `conversationId` field on bubbles is empty in current
// Cursor builds. The real composerId lives in the row key
// `bubbleId:<composerId>:<bubbleUuid>`. Extract from the key so the
Expand Down Expand Up @@ -487,7 +489,7 @@ function parseBubbles(db: SqliteDatabase, seenKeys: Set<string>): { calls: Parse

const costUSD = calculateCost(pricingModel, inputTokens, outputTokens, 0, 0, 0)

const timestamp = createdAt || new Date().toISOString()
const timestamp = createdAt
const userQuestion = takeUserMessage(userMessages, conversationId)
const assistantText = blobToText(row.user_text)
const userText = (userQuestion + ' ' + assistantText).trim()
Expand Down
Loading