Repository navigation
fix(openrouter): drop BYOK from saved rows, share one popup empty state, name every account - #1552
Merged
Merged
Conversation
…te, name every account Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes Reviewed the complete diff and traced saved-row rendering, shared usage breakdowns, and account naming through their callers and regression tests.
- Saved history rows: Descriptor-based filtering removes legacy BYOK figures from OpenRouter rows while preserving breakdown data and other providers' declared row values.
- Empty breakdowns: All-zero reported totals use the shared provider-specific message; non-zero totals and unread-day handling remain intact.
- Account names: Creation, rename, and stored-account repair provide visible default names, with API-key login and legacy import using the same convention.
- Validation: All changed Swift files passed syntax parsing. Full build and UI tests could not run on this Linux runner; the PR's Build and Test check was pending when inspected.
gpt-6-astra | 𝕏
…counts in the store only Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes Reviewed the incremental changes from 8659041 to cbbf39b, including cache loading, refresh behavior, and account-creation callers.
- Replaced saved-row filtering: Bumped the snapshot cache to
v12, preventing legacy BYOK rows from loading and requiring fresh reads for all accounts. - Centralized account naming: Removed redundant login/import naming changes while retaining normalization at the
AccountStoreboundary. - Updated regression coverage: Changed the saved-snapshot test to verify that a v11 snapshot is bypassed and a fresh dollar-only row is displayed.
- Validated syntax: All nine Swift files affected by the incremental commit passed syntax parsing. Full build and runtime tests require macOS and could not run on this Linux host; CI's Build and Test check was still running when inspected.
gpt-6-astra | 𝕏
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

TL;DR — OpenRouter rows no longer show BYOK on any path, every provider's popup gets the same empty state (" didn't report any data for this range."), and an account can no longer end up with no visible name.
What was happening
$0 · $0 BYOK. A fresh read on fix(openrouter): show dollars in history rows and tokens and BYOK in a Cursor-style popup #1550 is already dollars-only (the new zero-value test passes its row checks on main). The BYOK came from the snapshot an earlier build saved under the same cache key: it shows at launch and stays until a refresh succeeds, on a cache hit within 5 minutes or for as long as refreshes fail.$0-only range as having data ("a free request is possible"), so Today showed just$0. Cursor's popup had its own empty wording ("No Usage Today / Nothing charged and no tokens counted.").OpenRouter, and the card hides a name that only repeats the provider's, so the account showed no name. Rename already refused an empty field, butAccountStoreitself accepted a blank or provider-only name.What this changes
openusage.providerSnapshots.v12, as earlier shape changes did, so a snapshot saved with BYOK in the rows is never shown. The first launch after the update reads every account before its cards fill. BYOK stays in the popup.UsageBreakdown.isEmptyis now true whenever every reported figure is zero, and the sharedUsageBreakdownContentempty state reads "(provider.displayName) didn't report any data for this range." for every provider.noUsageTitleis removed. A range with any non-zero figure still shows what exists; missing days still count as 0.AccountStorenames every account at the boundary: add, rename, and load turn a blank or provider-only name into<Provider> Account(the default Claude, ChatGPT, Cursor, Grok, and Devin sign-ins already use), and a repaired load is saved and logged. Logins and the 0.7.x import go through the same store, so they get the name too. Robin's existing account becomes OpenRouter Account on next launch.Heads-up
$0ranges that used to show$0, and ChatGPT credit-only zero ranges.Claude,Ollama, …) are renamed to<Provider> Accounton load, and the card now shows that name above the rows.fullNamereads e.g.OpenRouter · OpenRouter Account, as Cursor's default already does.Tests (Mac mini, macOS 15.7.7,
nice -n 10 script/test_quiet.sh --filter, one suite at a time)$0 · $0 BYOK), AccountStoreTests (blank/provider-only add, rename, and stored-name repair), UsageBreakdownDetailTests ($0-only is empty), APIKeyV1FilesTests (imported name).OpenRouter, a snapshot saved under the old key with$0 · $0 BYOK, Management key, activity unreadable,$0everywhere).Screenshots
Dark:

Note
Medium Risk
On load it rewrites stored account labels and bumps the snapshot cache, changing visible names and forcing fresh provider reads; empty-popup behavior changes for zero-only ranges across providers.
Overview
OpenRouter dashboard rows no longer resurrect BYOK from older cached snapshots: the provider snapshot storage key moves to
v12, so stale Today/This Week/This Month lines with inline BYOK are discarded and fresh reads repopulate the card. BYOK remains available only in the range popup on hover.Usage range popups share one empty state: when every reported figure is zero,
UsageBreakdown.isEmptyis true (including spend-only$0), and the UI shows “<Provider> didn't report any data for this range.” instead of per-window “No Usage …” titles or a lone$0line.Account labels are normalized in
AccountStoreon add, rename, and load: blank or provider-only names become\<Provider\> Account, existing stored accounts are repaired and persisted on launch, and imports/tests expect the new default names so dashboard cards always show a visible label.Reviewed by Cursor Bugbot for commit cbbf39b. Bugbot is set up for automated code reviews on this repo. Configure here.