[codex] Add experimental Cursor source#5
Conversation
6f9c753 to
d4ab4c9
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d4ab4c9196
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if let Some(timestamp) = string_at(value, &["createdAt"]) | ||
| .or_else(|| string_at(value, &["timestamp"])) | ||
| .or_else(|| string_at(value, &["time"])) | ||
| { | ||
| return timestamp.parse::<DateTime<Utc>>().ok(); |
There was a problem hiding this comment.
Parse Cursor timingInfo timestamps before dropping entries
timestamp_from_value only looks for top-level createdAt/timestamp/time strings, but Cursor assistant bubbles with tokenCount commonly store their time in timingInfo millisecond fields (for example clientEndTime / clientSettleTime). In that case entry_from_bubble gets None for the timestamp and skips the record entirely, so --source cursor can show little or no usage even when token-bearing bubbles exist. Add timingInfo timestamp fallbacks before rejecting the entry.
Useful? React with 👍 / 👎.
Summary
cursor/cursourcestate.vscdbfiles in read-only modecursorDiskKVbubble records and legacyItemTablegeneration records when explicittokenCountfields are presentNotes
Cursor's local chat schema is not a stable public API. This PR intentionally keeps the source conservative: if Cursor does not persist non-zero token counts, ccstats reports no Cursor usage rather than showing approximate cost data.
References used for storage layout:
Validation
cargo fmt --checkcargo test --lockedgit diff --checkNote:
cargo clippy --all-targets -- -D warningsremains blocked by existing unrelated warnings. New clippy warnings introduced by this change were fixed before PR creation.