[GH-ISSUE #4678] Token counter shows "—" with native engine: tokensIn never reported (usageSource=unavailable #2132

Closed
opened 2026-11-04 01:56:56 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @Dark69Light on GitHub (Oct 30, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4678

[BUG] Token counter shows "—" with native engine: tokensIn never reported (usageSource=unavailable)

Environment:

  • Strata desktop 0.2.8, host/control 0.1.54, engine 0.1.54-windows-x86_64-cuda-cuda13
  • Windows, RTX 5090, model IQ3_S (native serve)

Symptom:
In the serving/usage panel the "Total tokens" field shows an em-dash "—" forever, even though chats run normally and the engine clearly counts tokens in its own log (strata serve: prompt 29757 tokens = 29708 reused + 49 read ... 561 generated).

Evidence:
GET http://127.0.0.1:47831/api/serving right after a completed chat request:

"stats": {"running":1,"waiting":0,"completed":1,"failed":0,"tokensOut":3304},
"requests": [
  { "state": "done", "tokensIn": null, "tokensOut": 3304, "usageSource": "unavailable" }
]

So the request log stores tokensIn: null and usageSource: "unavailable" for local native-engine requests. Only tokensOut is filled. The UI faithfully renders the missing input count as "—".

Expected:
Native engine serve frames include prompt tokens (the engine log line proves the engine knows them: "prompt N tokens = X reused + Y read"), so tokensIn should be populated (and cache stats, ideally) and the total counter should add up.

Steps to reproduce:

  1. Fresh start Strata desktop with native engine model loaded.
  2. Send one chat message.
  3. Open serving stats / call GET /api/serving.
  4. Entry shows tokensIn: null, usageSource: "unavailable"; UI "total tokens" stays "—".

Workaround: reading totals from the engine log (%LOCALAPPDATA%\Strata\install\strata-<model>.log), which has full per-request token accounting.

Originally created by @Dark69Light on GitHub (Oct 30, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/4678 # [BUG] Token counter shows "—" with native engine: tokensIn never reported (usageSource=unavailable) **Environment:** - Strata desktop 0.2.8, host/control 0.1.54, engine 0.1.54-windows-x86_64-cuda-cuda13 - Windows, RTX 5090, model IQ3_S (native serve) **Symptom:** In the serving/usage panel the "Total tokens" field shows an em-dash "—" forever, even though chats run normally and the engine clearly counts tokens in its own log (`strata serve: prompt 29757 tokens = 29708 reused + 49 read ... 561 generated`). **Evidence:** `GET http://127.0.0.1:47831/api/serving` right after a completed chat request: ```json "stats": {"running":1,"waiting":0,"completed":1,"failed":0,"tokensOut":3304}, "requests": [ { "state": "done", "tokensIn": null, "tokensOut": 3304, "usageSource": "unavailable" } ] ``` So the request log stores `tokensIn: null` and `usageSource: "unavailable"` for local native-engine requests. Only `tokensOut` is filled. The UI faithfully renders the missing input count as "—". **Expected:** Native engine serve frames include prompt tokens (the engine log line proves the engine knows them: "prompt N tokens = X reused + Y read"), so `tokensIn` should be populated (and cache stats, ideally) and the total counter should add up. **Steps to reproduce:** 1. Fresh start Strata desktop with native engine model loaded. 2. Send one chat message. 3. Open serving stats / call `GET /api/serving`. 4. Entry shows `tokensIn: null, usageSource: "unavailable"`; UI "total tokens" stays "—". **Workaround:** reading totals from the engine log (`%LOCALAPPDATA%\Strata\install\strata-<model>.log`), which has full per-request token accounting.
Author
Owner

@github-actions[bot] commented on GitHub (Oct 30, 2026):

Thanks for the issue. To keep the tracker readable, every item needs an area prefix in the title and the parts of the issue form filled in. This one is missing:

  • Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other], then a short description. Example: "[Engine] decode stops after 2 minutes".

Edit the issue (title and description) and this note goes away on its own. If it is still missing parts in 5 days it will be closed, which is not a rejection: fix it and comment /reopen.

Details: CONTRIBUTING.md

<!-- gh-comment-id:6516207393 --> @github-actions[bot] commented on GitHub (Oct 30, 2026): Thanks for the issue. To keep the tracker readable, every item needs an area prefix in the title and the parts of the issue form filled in. This one is missing: - [ ] Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other], then a short description. Example: "[Engine] decode stops after 2 minutes". Edit the issue (title and description) and this note goes away on its own. If it is still missing parts in 5 days it will be closed, which is not a rejection: fix it and comment `/reopen`. Details: [CONTRIBUTING.md](https://github.com/Niko1221/Strata/blob/main/CONTRIBUTING.md)
Author
Owner

@github-actions[bot] commented on GitHub (Nov 5, 2026):

Closing this issue because it still did not follow the format after 5 days. That is housekeeping, not a rejection.

To bring it back: fix the title (area prefix) and the missing parts, then comment /reopen. A check runs and reopens it, or tells you what is still missing. See CONTRIBUTING.md.

<!-- gh-comment-id:6649637299 --> @github-actions[bot] commented on GitHub (Nov 5, 2026): Closing this issue because it still did not follow the format after 5 days. That is housekeeping, not a rejection. To bring it back: fix the title (area prefix) and the missing parts, then comment `/reopen`. A check runs and reopens it, or tells you what is still missing. See [CONTRIBUTING.md](https://github.com/Niko1221/Strata/blob/main/CONTRIBUTING.md).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#2132
No description provided.