Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…ty summary (#703) Merge port/micro-0.61.0-openrouter-activity-summary. Both branches change openrouter/activity.rs: keep #703's checked safe-integer token aggregate as the single token total for the CLI history line (dropping this branch's separate saturating sum, which would double count after the merge), keep the cost provenance, and move this branch's tests to the ActivityReport return shape.
UI proof (browser-use)Result: PASS on build
At the maintainer's direction, this proof drove the app's WebView2 over CDP with the browser-use CLI instead of CUA. It used no keyboard, mouse or focus. Refreshes were DOM Setup
Fixture scenarios
Results
Validation at
|
| Command | Result |
|---|---|
cargo +1.98.0 fmt --all --check |
pass |
cargo +1.98.0 clippy --workspace --all-targets -- -D warnings |
pass |
cargo +1.98.0 test -p codexbar openrouter |
38 passed |
cargo +1.98.0 test -p codexbar |
2169 passed, 0 failed, 1 ignored |
cargo +1.98.0 test -p codexbar-desktop-tauri -- --skip bootstrap_payload_exposes_every_provider_variant |
461 passed, 0 failed. The skipped test is the non-hermetic #684 test that #711 fixes. |
Screenshots
All paths are under %LOCALAPPDATA%\Win-CodexBar\port-audit\proof\703\shots\.
| File | What it shows |
|---|---|
703-tray-s1-healthy.png |
S1: credits, API key and Activity rows with both meters. |
703-tray-s2-degraded.png |
S2: "Credits balance" and "Spend history" unavailable, with their reasons; the key lanes stay. |
703-tray-s3-no-cap-no-management.png |
S3: "No limit configured" and "Management API key not configured". |
703-tray-s4-invalid-key.png |
S4: "API key limit: Unavailable right now" with "Response was invalid". |
703-settings-providers-s1.png |
Settings > Providers: the OpenRouter rows in the detail pane. |
Not blocking (already on main)
None of these come from this PR; its diff touches only rust/src/providers/openrouter/.
- Settings > Providers doesn't show the secondary values ("Spending cap, not balance", the unavailable reasons), because
UsageSectionpasses nosecondaryClassNametoProviderDisplayRow. The same pane labels OpenRouter's two meters "Session" and "Weekly", where the tray says "Credits" and "API key limit". - In the tray, a row's secondary text sits flush against its value with no separator, for example "Unavailable right nowRequest returned HTTP 500" (
DisplayDetailRowinMenuCardDetails.tsx). - The overview "Usage & Spend · 30d" header kept showing $2.25 after Activity failed in S2 to S4.
OverviewSpendSummaryfetchesget_usage_spend_summaryonly when the provider ids change. A read-only call after S2 already returnedthirtyDay: nullfor OpenRouter. - An empty
global_shortcutlogsWARN codexbar_desktop_tauri::shortcut_bridge: Could not parse global shortcut:at every launch. This was already reported on Fix reset refresh timer for resets over 24.8 days away #720.
…rovenance and token totals (stacked on #703)
|
Adversarial validation passed at 084d019 Scope: OpenRouter diagnostics and Activity summary (#703, upstream 0.61.0 steipete#3272/steipete#3733), validated as merged into release/v0.70.0 (merge 084d019). Attacks (highest-risk semantics, from the merged tree):
No defects found. The browser-use proof (issuecomment-5924935539 at 3e63802) covered all four seed branches across tray and Settings. READY for the un-draft rule. |
Found by the 0.60.4-0.69.0 port gap audit.
Summary
OpenRouter now reports why an optional request degraded and shows an Activity summary, matching upstream v0.61.0:
/credits,/keyand Activity each get a 4 s deadline (was 30 s credits, 1 s key and Activity).Request timed out,Request failed,Request returned HTTP <n>,Response was invalid,Management API key requiredfor an Activity 403,Management API key not configured). The reason was previously only logged at debug level; it now appears in the provider detail rows and the CLI text output.Credits balance: Unavailable right nowwith the reason), API key limit (with "Spending cap, not balance"), API key remaining / used, Reset window (orNo limit configured, orUnavailable right nowwith the reason), Activity tokens / requests / models for the last 30 completed UTC days (orSpend history (last 30 days): Unavailable right nowwith the reason).Rows use the existing
ProviderDisplayDetailpath (menu card, provider detail pane, CLI), so no bridge or frontend change was needed.Upstream reference
aca09cf2f) and "distinguish invalid responses from request failures" (fix(openrouter): distinguish invalid responses from request failures steipete/CodexBar#3733,6cd74d02e).Sources/CodexBarCore/Resources/Plugins/openrouter.js(requestDegradationReason,activityDetails,detailssections,optionalRequestTimeoutSeconds = 4),docs/openrouter.md.Ported / Deferred
Ported: items above.
Deferred:
costUsage.entries). They only feed upstream's Usage & Spend model breakdown; Win-CodexBar'sCostSnapshothas no per-model shape, so this needs a separate spend-catalog change.Activity tokens) becauseProviderDisplayDetailhas no section grouping. Titles are English strings like other providers' detail rows; no locale keys were added.Validation
All with
cargo +1.98.0, slot-5 target dir, E-core wrappers:cargo fmt --all: cleancargo clippy --workspace --all-targets -- -D warnings: passcargo test -p codexbar openrouter: 38 passed, 0 failed (new: detail rows for success, uncapped key and degraded sources; HTTP status and auth typing; timeout vs other transport failure against a stalled local listener; Activity summary counts, dedupe, model counting, safe-integer aggregate overflow)cargo test -p codexbar(full): 2169 passed, 0 failed, 1 ignoredpnpm testnot run.Affected areas
UI proof
Pending: coordinator will capture CUA proof on a fresh build.