mirror of
https://github.com/Pasta-Devs/Marinara-Agents.git
synced 2026-12-03 18:55:07 +07:00
[PR #2092] [MERGED] fix(otome-forge): a chapter's calls share one cached story context for an hour; no repeated last-chapter summary (0.7.6) #2112
Labels
No labels
agent: chess
agent: conversation-calls
agent: eightball
agent: haptic
agent: hierarchical-maps
agent: hierarchical-maps
agent: illustrator
agent: poker
agent: rock-paper-scissors
agent: tic-tac-toe
agent: uno
artifacts
bug
bugfix
build
catalog
ci
client
dependencies
docs
documentation
enhancement
feature
fixed-in-staging
in-pr
normal-scope
packages
pull-request
qol
regression
roadmap
scope-risk
server
soup
upstream
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Agents#2112
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?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Agents/pull/2092
Author: @SpicyMarinara
Created: 11/3/2026
Status: ✅ Merged
Merged: 11/3/2026
Merged by: @SpicyMarinara
Base:
staging← Head:fix/otome-cache-stable-prefix📝 Commits (4)
25e803bchore(otome-forge): start the 0.7.6 caching work3761600fix(otome-forge): a chapter's calls share one cached story context for an hour (0.7.6)ea430bbfix(otome-forge): the cached part holds shared canon only; the last chapter's summary is never repeated (0.7.6)aa7d580fix(otome-forge): a cached story context worked out per call, the same for every cast (0.7.6)📊 Changes
23 files changed (+585 additions, -253 deletions)
View changed files
➕
artifacts/otome-forge-0.7.6.zip(+0 -0)📝
catalog/preview/catalog.json(+6 -6)📝
catalog/preview/notes.json(+6 -6)📝
catalog/preview/v2/catalog.json(+6 -6)📝
catalog/preview/v2/notes.json(+6 -6)📝
catalog/preview/v3/catalog.json(+6 -6)📝
catalog/preview/v3/notes.json(+6 -6)📝
packages/otome-forge/CHANGELOG.md(+5 -0)📝
packages/otome-forge/manifest.json(+3 -3)📝
packages/otome-forge/server.mjs(+133 -130)📝
packages/otome-forge/src/engine/packages/server/src/services/otome-forge/generation.ts(+14 -6)📝
packages/otome-forge/src/engine/packages/server/src/services/otome-forge/memory/memory.ts(+11 -8)📝
packages/otome-forge/src/engine/packages/server/src/services/otome-forge/memory/timeline.ts(+28 -9)📝
packages/otome-forge/src/engine/packages/server/src/services/otome-forge/prompts.ts(+36 -15)📝
packages/otome-forge/src/engine/packages/server/src/services/otome-forge/story/beats.ts(+4 -2)📝
packages/otome-forge/src/engine/packages/server/src/services/otome-forge/story/canon.ts(+87 -28)📝
packages/otome-forge/src/engine/packages/server/src/services/otome-forge/story/chapters.ts(+2 -2)📝
scripts/build-feature-packages.mjs(+1 -1)📝
tests/otome-forge-beats.regression.ts(+148 -5)📝
tests/otome-forge-date-night.regression.ts(+4 -1)...and 3 more files
📄 Description
Why
Otome Hearth's prompt caching stopped paying off. The maintainer's Anthropic usage showed cache writes on most calls and almost no cache reads. A chapter's plan, scenes and climax are meant to share one cached story context: rules, contract, world, protagonist, the arc's line, story memory and the previous chapter. Three things kept breaking that:
The maintainer also asked that the last chapter's summary never be sent beside that chapter in full. A main prompt sends the previous main chapter in full and leaves its timeline entry out. However, condensing a long timeline folded everything but the newest entry into the condensed head. When a route chapter or Character Story came after the newest main chapter, that main chapter's summary went into the head and was repeated.
Closes #2091
What changed
generateJsonasks forcacheTtl: "1h"on any prompt with cache marks. That covers the plan (P5), the scenes (P6), the Confrontation (P12) and the Closer (P12c). The option needs capability API 1.815, from Engine PR Pasta-Devs/Marinara-Engine#8748 (merged). An older Engine ignores it and keeps the five-minute cache, so the package's capability floor stays at 1.386.recallTexttakes a newcachedoption, which replacesapart:player-choices-server.mjs) is unchanged.ponytail:note intimeline.tslists the cases that can still repeat a summary: an older previous route chapter, and the newest main chapter once enough side chapters follow it.Validation
pnpm test:otome-forge: 637 + 13 pass, 0 fail.node scripts/typecheck-packages.mjs otome-forge: no strict errors.chapters.ts.cacheTtl: "1h". It fails without the fix.cached.a cached story context is what every call of its chapter may know…checks that the context is byte-identical across casts, with private canon and recalls following each call. It also checks the chapter's own love interest's canon is cached in his own chapter, and that a chapter joining the timeline is there for every call. In the canonical history, a long date doesn't push Night 1 out of the shared part. That last check fails without the shared-first bound.condensing keeps the newest main chapter's entry apart…puts a Character Story after the newest main chapter. The condensing must leave that chapter's entry apart, and the main story's prompt must never carry its summary. It fails without the fix. A unit test covers the fallback branch.cacheTtl: "1h"on marked prompts and no TTL on unmarked ones.beat/beatWithCgwere updated, because the line moved.Not in this PR (maintainer's call)
Manual verification
🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.