Skip to content

Port upstream 0.61.0: OpenRouter diagnostics and Activity summary - #703

Draft
Finesssee wants to merge 1 commit into
port/upstream-0.61.0from
port/micro-0.61.0-openrouter-activity-summary
Draft

Finesssee wants to merge 1 commit into
port/upstream-0.61.0from
port/micro-0.61.0-openrouter-activity-summary

Conversation

@Finesssee

Copy link
Copy Markdown
Collaborator

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, /key and Activity each get a 4 s deadline (was 30 s credits, 1 s key and Activity).
  • Degraded requests carry a safe reason (Request timed out, Request failed, Request returned HTTP <n>, Response was invalid, Management API key required for 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.
  • New detail rows: Credits remaining / used / total added (or Credits balance: Unavailable right now with the reason), API key limit (with "Spending cap, not balance"), API key remaining / used, Reset window (or No limit configured, or Unavailable right now with the reason), Activity tokens / requests / models for the last 30 completed UTC days (or Spend history (last 30 days): Unavailable right now with the reason).
  • Activity aggregation checks the safe-integer range for tokens, reasoning tokens and requests like upstream. Tokens are prompt + completion; reasoning is not added again.

Rows use the existing ProviderDisplayDetail path (menu card, provider detail pane, CLI), so no bridge or frontend change was needed.

Upstream reference

Ported / Deferred

Ported: items above.

Deferred:

  • Per-model, per-date Activity entries on the cost snapshot (upstream costUsage.entries). They only feed upstream's Usage & Spend model breakdown; Win-CodexBar's CostSnapshot has no per-model shape, so this needs a separate spend-catalog change.
  • Upstream's "Today / This week / This month" key-spend detail rows and the "Key spend" bar chart. The same values already show as the Daily/Weekly/Monthly spend lanes on Windows, so duplicating them would repeat rows.
  • Upstream's "Response was unavailable" reason: no equivalent state exists locally (a missing body is a parse failure).
  • Flat detail rows carry the section name in the title (for example Activity tokens) because ProviderDisplayDetail has 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: clean
  • cargo clippy --workspace --all-targets -- -D warnings: pass
  • cargo 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 ignored
  • Tauri crate and frontend untouched; pnpm test not run.

Affected areas

  • Provider (OpenRouter)
  • UI surface (provider detail rows in menu card, detail pane, CLI text)
  • Settings, tray, float bar, installer

UI proof

Pending: coordinator will capture CUA proof on a fresh build.

@coderabbitai

coderabbitai Bot commented Sep 30, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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