mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #5763] Context usage indicator omits Anthropic prompt-cache tokens #3185
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#3185
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 @Gunterlie on GitHub (Sep 2, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5763
$## Bug Report\n\n### Summary\nThe context usage indicator can show a very small value in long chats when an Anthropic connection serves most of the prompt from its cache.\n\n### Observed behavior\nA long roleplay chat can show about 3.5k tokens even after hundreds of messages.\n\n### Expected behavior\nThe indicator should include fresh input tokens, cache-read input tokens, cache-write input tokens, and the current assistant response. Cached tokens still belong to the active model context.\n\n### Root cause\nAnthropic returns
input_tokens,cache_read_input_tokens, andcache_creation_input_tokensseparately. The usage persistence path stored onlyinput_tokens, and the client calculation could not include the cached prompt.\n\n### Scope\nThis report targets Anthropic API and Claude subscription connections with prompt caching enabled.\n\n### Proposed fix\nPersist Anthropic cache usage fields and include them in the context indicator. Add regression coverage for cached long-chat usage.\n\n### Environment\nReported on Marinara Engine 2.4.5, Android/Termux, Claude Opus 4.6 via the Anthropic provider.