G
YouTube TikTok Games
Skip to content

fix(desktop): Count only model calls as requests, keep the composer on one row - #1634

Merged
kotevcode merged 2 commits into
mainfrom
fix/desktop-new-user-polish
Nov 12, 2026
Merged

kotevcode merged 2 commits into
mainfrom
fix/desktop-new-user-polish

Conversation

@kotevcode

Copy link
Copy Markdown
Contributor

Problem

  • On a new install, the desktop's own GET /v1/models polls counted as requests on its key, so Home showed requests the user never made and treated a new user as a returning one.
  • The sidebar chat list ran right up to the balance card.
  • A long model name wrapped the composer's pickers onto a second row.

Change

  • Gateway: a key's request count (GET /v1/key usage.requests, the console's key list, antseed gateway key usage) counts only calls to a model. The request log still shows every call.
  • Desktop: 12px between the chat list and the balance card, a little room after the last chat.
  • Desktop: the chat and Home composers stay on one row; the model name ellipsizes, icons and tags keep their size.

Evidence

  • apps/cli gateway tests pass (399), incl. a new store test: five model-list reads count 0, one prompt counts 1, the log keeps all 6, and counts hold after pruning. It fails on the old store.ts.
  • Checked in the running desktop on a fresh profile and on an existing one.
  • Touches money paths: no.

@reviewant-app

reviewant-app Bot commented Nov 12, 2026

Copy link
Copy Markdown

Reviewant Review Summary

Reviewed commit: 73710c8a17 (review 1 of this PR). The branch has moved since: newer commits are not covered by this review.

The PR changes gateway key request counts to include only requests with a recorded model, excluding model-list polling and other model-less reads while retaining them in the request log. The filter applies to both live requests and historical rollups, with a regression test covering pruning. Desktop stylesheet changes keep composer controls on one row, preserve model-picker icons and tags, and add spacing above the sidebar balance card.

  • No issues found in the reviewed changes.

Confidence Score: 5/5

Safe to merge; no verified issues found.

Verified the changed counting functions, their direct callers, request model extraction, and rollup creation; the change preserves historical filtering without altering spend accounting or budget enforcement. The provided CLI test runner completed successfully: 2,238 passed, 3 skipped, and no failures. The full diff contained no dependency, installation, CI, or suspicious hidden-behavior changes. Desktop layout was reviewed through styles and component structure, but not visually exercised.

Important Files Changed

Filename Overview
apps/cli/src/gateway/store.ts Filters key request and failure counts by non-null model in both live records and rollups; the existing rollup schema preserves the information needed.
apps/cli/src/gateway/store-data.test.ts Adds a passing regression test confirming model listings do not count as usage before or after pruning and remain visible in the request log.
apps/desktop/src/renderer/ui/components/ChatListPanel.module.scss Adds bottom spacing to the chat panel and scrollable list without changing interaction behavior.
apps/desktop/src/renderer/ui/components/chat/ChatModelDropdown.module.scss Prevents non-label trigger children from shrinking so the model label absorbs constrained width.
apps/desktop/src/renderer/ui/components/views/ChatView.module.scss Keeps composer metadata on one row and adjusts flex sizing so model and workspace labels can shrink.
apps/desktop/src/renderer/ui/components/views/VprHomeView.module.scss Removes composer footer wrapping to match the chat composer layout.
apps/website/docs/gateway/api.md Documents the revised model-call-only meaning of usage.requests.
CHANGELOG.md Records the gateway counting change and desktop spacing and composer adjustments.

Core files read in full: apps/cli/src/gateway/store.ts, apps/cli/src/gateway/store-data.test.ts, apps/cli/src/gateway/request-shaping.ts, apps/cli/src/gateway/pinned-model.ts, apps/cli/src/gateway/key-savings.ts

Reviews (1): Last reviewed commit: 73710c8a17 | automatic review of a new PR | Tag @reviewant with "re-review" to run again

@kotevcode
kotevcode merged commit 149df23 into main Nov 12, 2026
12 checks passed
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