mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #7925] [Issue]: Claude (Subscription) fails with "A maximum of 4 blocks with cache_control" when the 1-hour cache is on #4358
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#4358
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 @stonebystone on GitHub (Oct 21, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/7925
Originally assigned to: @SpicyMarinara on GitHub.
Summary
Since #7866 merged, every Claude (Subscription) request with Extended token caching (1 hour) on fails with:
Expected behavior
Replies generate normally, and the previous turns' chat history is read from the prompt cache.
Actual behavior
The request is rejected. #7866 added one
cache_controlto the resumed chat history. When Marinara runs it, Claude Code already places four markers itself: two on the system prompt and two on the last two messages. The extra one makes five.It passed testing because the live tests ran from inside the Claude desktop app. In that environment the same five-marker request is accepted (the desktop entrypoint is handled differently). A normal Marinara server environment gets the error.
Steps to reproduce
Turning the 1-hour setting off avoids the error, because #7866 only adds the marker in that mode.
Environment
d0e481913)Additional context
</chat_history>is appended to that entry and moves every turn, so the marked entry never matches the next request.</chat_history>close to the start of the current turn on the Claude (Subscription) resume path. Live test (Opus 5.5, server-like environment, 26k-token prompt): from the third turn on, each turn reads the whole history from cache and writes about 100 tokens, with the 1-hour cache on or off, and no errors.cc @SpicyMarinara
Template check
@SpicyMarinara commented on GitHub (Oct 21, 2026):
Thank you for the PR; it's merged. ;)