Skip to content

fix: remove silent fallback paths#17

Merged
tyql688 merged 3 commits intomasterfrom
fix/fallback-check-2026-04-14
Apr 14, 2026
Merged

fix: remove silent fallback paths#17
tyql688 merged 3 commits intomasterfrom
fix/fallback-check-2026-04-14

Conversation

@tyql688
Copy link
Copy Markdown
Owner

@tyql688 tyql688 commented Apr 14, 2026

Summary

  • remove frontend fake-empty and fake-zero fallbacks and replace silent failures with explicit UI error states, toast messages, or logs
  • stop backend pricing, usage, indexer, and provider parser paths from swallowing errors or fabricating plausible-but-wrong data
  • tighten parser and utility error handling so invalid files, rows, and metadata failures are warned or skipped explicitly instead of silently disappearing

Testing

  • npx tsc --noEmit
  • npx eslint "src//*.ts" "src//*.tsx"
  • cargo test --quiet

Commit

  • 26a54b6 fix: remove silent fallback paths

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.
@tyql688 tyql688 force-pushed the fix/fallback-check-2026-04-14 branch from 08c0d6e to 26a54b6 Compare April 14, 2026 08:44
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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()?;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment on lines +279 to +283
"failed to read Cursor transcript created time '{}': {}",
path.display(),
error
);
return None;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment thread src-tauri/src/indexer.rs
}
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 {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@tyql688 tyql688 merged commit 70c3e17 into master Apr 14, 2026
3 checks passed
@tyql688 tyql688 deleted the fix/fallback-check-2026-04-14 branch April 14, 2026 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant