Repository navigation
fix(desktop): Count only model calls as requests, keep the composer on one row - #1634
Conversation
Reviewant Review SummaryReviewed commit: 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.
Confidence Score: 5/5Safe 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.
|
| 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
Problem
GET /v1/modelspolls counted as requests on its key, so Home showed requests the user never made and treated a new user as a returning one.Change
GET /v1/keyusage.requests, the console's key list,antseed gateway key usage) counts only calls to a model. The request log still shows every call.Evidence
apps/cligateway 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 oldstore.ts.