Conversation
Surface real frontend and provider failures instead of fabricating empty states or guessed data. This keeps usage stats, parser behavior, and settings handling aligned with the no-silent-fallback policy.
08c0d6e to
26a54b6
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 08c0d6eb4c
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| Ok(c) => c, | ||
| Err(_) => return Ok(Vec::new()), | ||
| }; | ||
| let conn = self.open_db()?; |
There was a problem hiding this comment.
Return empty OpenCode scan when database file is absent
scan_all now does self.open_db()?, but open_db returns NotFound whenever ~/.local/share/opencode/opencode.db is missing. Because Indexer::reindex propagates provider scan errors (scan_all()?), users who do not have OpenCode installed will fail the entire indexing pass (not just OpenCode). This is a regression from the previous behavior that treated missing OpenCode data as “no sessions,” and it blocks indexing for unrelated providers.
Useful? React with 👍 / 👎.
| "failed to read Cursor transcript created time '{}': {}", | ||
| path.display(), | ||
| error | ||
| ); | ||
| return None; |
There was a problem hiding this comment.
Keep Cursor transcript when file creation time is unavailable
parse_transcript_jsonl now returns None if metadata.created() fails, which can happen on supported deployments (notably filesystems/platforms that do not expose birth time). In those environments, readable Cursor transcripts will be dropped entirely during scan/load, so sessions disappear even though parsing succeeded. This should not hard-fail the session parse; use another stable timestamp source instead.
Useful? React with 👍 / 👎.
| } | ||
| if let Some(usage) = &msg.token_usage { | ||
| // Dedup: skip if this usage entry was already counted (cross-file) | ||
| if let Some(ref mut seen) = seen_hashes { |
There was a problem hiding this comment.
Mark usage hash as seen only after usage row is accepted
The dedup hash is inserted before validating timestamp/model. If the first copy of a duplicated usage record is skipped for missing fields, its hash is still consumed, and a later duplicate with valid fields is dropped as “already seen,” causing undercounted token stats. This was introduced with the new skip-on-missing-field logic, so dedup should happen only after a row passes validation.
Useful? React with 👍 / 👎.
Summary
Testing
Commit