mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #6218] [Issue]: Gemini cache hits are never reported because cachedContentTokenCount is not parsed #3467
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#3467
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @kolacheee on GitHub (Sep 15, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/6218
Originally assigned to: @SpicyMarinara on GitHub.
Summary
The Gemini adapter reads the prompt, candidate, total and thoughts token counts from
usageMetadatabut nevercachedContentTokenCount, so any savings from Gemini's implicit caching are invisible in every token readout.Expected behavior
The per-message token usage and Peek Prompt show cache hit tokens for Gemini the way they do for Anthropic and OpenAI, so a user can tell whether caching is doing anything.
Actual behavior
GeminiUsageMetadatainpackages/server/src/services/llm/providers/google.provider.ts:53-58declares no cached field.geminiUsage(:564-570) and the two inline usage sites (:1024-1027,:1089-1092) never setcachedPromptTokens, so the readouts have nothing to show.Steps to reproduce
cachedContentTokenCount.Environment
29ee24fc2)Logs, screenshots, or video
Not applicable; the missing field is visible at the cited lines.
Additional context
One field on the interface and one line at each usage site is enough to make it visible. Explicit
cachedContentscaching is a separate question and probably not worth it while the prompt is refitted before every send; measuring implicit caching first is the cheap step.Template check
Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:
@SpicyMarinara commented on GitHub (Sep 15, 2026):
Owner: @SpicyMarinara, with Codex implementing this issue as part of the requested sweep in draft PR #6230 against
staging. I checked the open PRs and issue-linked work before starting; no competing open PR was found.@SpicyMarinara commented on GitHub (Sep 15, 2026):
Merged in #6230 to staging (
c6685f7034).Gemini cachedContentTokenCount is now included in reported cached prompt tokens, across direct/Vertex and buffered/streaming request paths. Verified with captured HTTP responses in the provider regression.