[GH-ISSUE #8746] [Feature]: let a package's call choose the cache time of its marked prompt (capability API 1.815) #8482

Closed
opened 2026-11-07 16:43:15 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @SpicyMarinara on GitHub (Nov 3, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/8746

Originally assigned to: @SpicyMarinara on GitHub.

What problem does this solve?

A capability package that marks a stable prompt prefix (capability API 1.814 cacheBreakpoint) gets the connection's cache time: 5 minutes unless the connection has "Extended token caching (1 hour)" on. Otome Hearth writes each scene when the player reaches the previous one, usually more than 5 minutes apart. Its cached story context therefore expires between scenes, and every scene pays the cache-write price again. The maintainer's Anthropic usage on 2026-11-03 showed about 534k cache-write tokens and 30k cache-read tokens in four hours.

Proposed solution

Capability API 1.815: chatComplete takes cacheTtl: "5m" | "1h" for the call's marked prefix.

  • On Anthropic it sets the TTL of the marked breakpoints.
  • Left out, the connection's cache time applies, as now.
  • A call with no marked message, and providers that cache on their own, ignore it.
  • Older Engines ignore the option.

Alternatives considered

Asking every player to turn on the connection's 1-hour cache. That works, but it applies to all of that connection's calls, not only the prefixes a package knows it will reuse.

Originally created by @SpicyMarinara on GitHub (Nov 3, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/8746 Originally assigned to: @SpicyMarinara on GitHub. ## What problem does this solve? A capability package that marks a stable prompt prefix (capability API 1.814 `cacheBreakpoint`) gets the connection's cache time: 5 minutes unless the connection has "Extended token caching (1 hour)" on. Otome Hearth writes each scene when the player reaches the previous one, usually more than 5 minutes apart. Its cached story context therefore expires between scenes, and every scene pays the cache-write price again. The maintainer's Anthropic usage on 2026-11-03 showed about 534k cache-write tokens and 30k cache-read tokens in four hours. ## Proposed solution Capability API 1.815: `chatComplete` takes `cacheTtl: "5m" | "1h"` for the call's marked prefix. - On Anthropic it sets the TTL of the marked breakpoints. - Left out, the connection's cache time applies, as now. - A call with no marked message, and providers that cache on their own, ignore it. - Older Engines ignore the option. ## Alternatives considered Asking every player to turn on the connection's 1-hour cache. That works, but it applies to all of that connection's calls, not only the prefixes a package knows it will reuse.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#8482
No description provided.