Repository navigation
Studio: Show token usage and cache stats on connected provider chats - #11717
Conversation
…body test Assert the connected-provider opt-in through the existing AST lookup instead of a regex slice, collapse the route test to one filtering case and one strict-endpoint case, and update the stream_options doc to cover connected providers.
|
Pushed fa7dcdc, test and doc cleanup only; the one-line fix in
Scope note: providers that are never asked upstream for usage (custom, deepseek, qwen, huggingface, ollama, llama_cpp) show the bar only if their server sends usage unprompted. That is unchanged by this PR. |
|
Codex converged at CI on the same head (staging Lyxot#82): 48 passed, 0 failed, 2 skipped (the GPU smoke gate, skipped here as well). |
Lyxot
left a comment
There was a problem hiding this comment.
LGTM. Restores the usage bar and cache stats on connected-provider chats by opting in the same way local chats do; the upstream request is unchanged. Codex converged and staging CI passed at fa7dcdc. The two upstream failures are unrelated: the image-train rail contract test fails on main too, and the Windows Chat UI lane timed out at login before any chat request.
…nslothai#11717) * Studio: request the stream usage chunk on connected-provider chats * test(studio): fold the provider usage opt-in check into the external body test Assert the connected-provider opt-in through the existing AST lookup instead of a regex slice, collapse the route test to one filtering case and one strict-endpoint case, and update the stream_options doc to cover connected providers. --------- Co-authored-by: Lyxot <[email protected]>
When chatting with OpenAI, Anthropic, Gemini, OpenRouter or a custom provider, the token usage bar never showed up and cache stats were missing. Token counts were only rough guesses. Local model chats were fine.
The chat request for providers now asks for usage data, the same way local chats already do. Nothing extra is sent to the provider, and API users who don't ask for usage still don't get it.