What happened
When running Desktop from the latest main, opening Settings → Usage and changing the time range to All can make the application completely unresponsive with an existing local Usage history.
The Usage page stops responding and does not recover within the observed time. Command+Q also does not cause the Electron application to exit. I have to return to the terminal and manually kill the Electron processes.
Expected behavior:
- Selecting All should keep the Desktop responsive while Usage data is loading.
- The page should present a loading, partial, or paginated state rather than materializing an unbounded activity history.
- The application should remain possible to quit while a Usage query is running.
How to reproduce
- Build and run Desktop from commit
5a1514c1d on main.
- Use an existing local profile containing accumulated model-call and tool-usage history.
- Open Settings.
- Select Usage.
- Change the time range to All.
- Observe that the Usage page and application become unresponsive.
- Press
Command+Q.
- Observe that the Electron application remains running.
- Kill the Electron processes manually from the terminal.
The issue appears to depend on the amount of accumulated Usage data. I have not yet reduced it to an exact record-count threshold or reproduced it with a clean profile.
Environment
- Maka version or commit:
5a1514c1d
- Branch:
main
- OS and version: macOS 15.6 (
24G84), arm64
- Surface: Desktop, running from source
- Node.js version:
v24.19.0
- npm version:
11.17.0
Logs, screenshots, or additional context
This report is related to the same Settings → Usage read path as #4058 and #4068, but the observed defect is different:
Initial static investigation of main found the following potential amplification path:
loadUsageStats() loads the summary, all LLM activity, all tool activity, and pricing together.
- Activity is paged in protocol frames of 100 records, but Desktop continues requesting pages until it has accumulated the complete activity set, capped at 50,000 LLM rows and 50,000 tool rows.
- The current SQLite Usage reader materializes, JSON-decodes, filters, and sorts the matching range before applying
slice(offset, offset + limit), so each protocol page can repeat work over the full range.
- Desktop then merges, aggregates, and sorts the accumulated arrays.
- When request details are displayed, renderer code maps the complete activity array into a non-paginated/non-virtualized table.
Relevant paths:
apps/desktop/src/main/runtime-host-usage-ipc-main.ts
apps/desktop/src/renderer/features/usage/ui/usage-settings-view.tsx
apps/desktop/src/renderer/features/usage/ui/usage-stats-table.tsx
packages/storage/src/sqlite-usage-store.ts
packages/runtime-host/src/protocol/usage-pricing.ts
The current implementation in #4068 may reduce repeated Storage scans and serialize overlapping range reloads, but it still:
- captures up to 50,000 LLM rows and 50,000 tool rows into a Host memory snapshot;
- pages both snapshots to Desktop until the arrays are complete;
- aggregates all returned rows in Desktop main;
- can pass the complete activity array to the renderer table.
For that reason, #4068 may mitigate this reproduction but does not appear to establish a bounded end-to-end read or render path.
The P1 design proposed in the final #4068 review appears relevant to this defect:
- return summary and SQL
GROUP BY projections with only the first bounded activity page in one Storage transaction;
- fetch later activity pages on demand using a stable
(ts, id)-style cursor;
- stamp pages with a Usage revision and return
revision_changed for stale continuations;
- use
hasMore instead of traversing the full data set to compute or transfer an exact total;
- keep the Runtime Host stateless rather than retaining a full in-memory activity snapshot;
- render only a bounded page of activity rows.
Related:
Additional evidence that would be useful but has not yet been collected:
- model-call and tool-invocation row counts for the affected profile;
- Activity Monitor CPU and memory observations;
- a macOS Sample Process capture while the application is stuck;
- whether request details were enabled at the time of reproduction;
- comparison with a clean profile and with the
24h, 7d, and 30d ranges.
What happened
When running Desktop from the latest
main, opening Settings → Usage and changing the time range to All can make the application completely unresponsive with an existing local Usage history.The Usage page stops responding and does not recover within the observed time.
Command+Qalso does not cause the Electron application to exit. I have to return to the terminal and manually kill the Electron processes.Expected behavior:
How to reproduce
5a1514c1donmain.Command+Q.The issue appears to depend on the amount of accumulated Usage data. I have not yet reduced it to an exact record-count threshold or reproduced it with a clean profile.
Environment
5a1514c1dmain24G84), arm64v24.19.011.17.0Logs, screenshots, or additional context
This report is related to the same Settings → Usage read path as #4058 and #4068, but the observed defect is different:
Initial static investigation of
mainfound the following potential amplification path:loadUsageStats()loads the summary, all LLM activity, all tool activity, and pricing together.slice(offset, offset + limit), so each protocol page can repeat work over the full range.Relevant paths:
apps/desktop/src/main/runtime-host-usage-ipc-main.tsapps/desktop/src/renderer/features/usage/ui/usage-settings-view.tsxapps/desktop/src/renderer/features/usage/ui/usage-stats-table.tsxpackages/storage/src/sqlite-usage-store.tspackages/runtime-host/src/protocol/usage-pricing.tsThe current implementation in #4068 may reduce repeated Storage scans and serialize overlapping range reloads, but it still:
For that reason, #4068 may mitigate this reproduction but does not appear to establish a bounded end-to-end read or render path.
The P1 design proposed in the final #4068 review appears relevant to this defect:
GROUP BYprojections with only the first bounded activity page in one Storage transaction;(ts, id)-style cursor;revision_changedfor stale continuations;hasMoreinstead of traversing the full data set to compute or transfer an exact total;Related:
Additional evidence that would be useful but has not yet been collected:
24h,7d, and30dranges.