Repository navigation
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the UsageProcessor._details_if_cached method to always return PromptTokensDetails even when the cached token count is 0. This change allows clients to distinguish between cache reporting being enabled with zero cached tokens versus cache reporting being disabled. Additionally, a new unit test suite has been added to verify this behavior under different configurations. I have no feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
d8b13bd to
b891fb8
Compare
|
@ispobock @CatherineSue @slin1237 @merrymercy @JustinTong0323 Could I get a quick review and |
|
@ispobock could you take a look at this usage-reporting fix if you have bandwidth? It reports |
b891fb8 to
ce1ca23
Compare
ce1ca23 to
2e5bf81
Compare
|
@ispobock @JustinTong0323 this is refreshed on current |
Keep only the legacy Completions remainder of sgl-project#28801; the response/final-stream and Chat zero-value fix is split into sgl-project#44010. Credit @rlrs for the earlier investigation in sgl-project#20203.
2e5bf81 to
e7b6ff2
Compare
The
/v1/completionsstreaming handler tracks cached tokens but omits them fromcontinuous_usage_statschunks. This addsprompt_tokens_detailswith the per-choice cached count when--enable-cache-reportis enabled, including zero. Disabled reporting stays unchanged.Adds a handler regression test for zero, positive, and disabled-reporting cases. The response/final-stream and Chat zero-value fix is split into #44010; these PRs can merge independently.
Thanks to @rlrs for the earlier investigation and implementation in #20203.
Validation: pre-commit and
git diff --checkpassed. Isolated streaming checks passed for cache counts, reporting flags, repeated chunks, and multiple choices; the same checks reproduce the bug onmain. Full registered handler tests were not run locally because PyTorch/FastAPI are unavailable.CI States
Latest PR Test (Base): ❌ Run #38368450828
Latest PR Test (Extra): ❌ Run #38368450626
Latest PR Test (AMD ROCm 10): ❌ Run #38368450892