mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #2034] Generation and autonomous checks still load full chat histories #996
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#996
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 @Xelvanis on GitHub (Jun 3, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2034
Originally assigned to: @cha1latte on GitHub.
Problem
Several hot paths still load a full chat transcript when they only need recent or summary-shaped data.
Current refactor evidence on
origin/refactor:src/engine/generation/start-generation.ts:846definesgenerationMessageLoadOptions, but:851returns no cap unlesscontextMessageLimitor requesthistoryLimitis set. Normal chats with default metadata callloadChatMessageswithout options at:2447,:2461,:2463, and:2548.src/engine/generation/context.ts:75wrapsstorage.listChatMessages; without options it reads the full chat.src/engine/generation/start-generation.ts:2372and:2414use full transcript reads for retry/lorebook-keeper paths.src/engine/modes/chat/autonomous/autonomous.service.ts:66-67loads all messages for a chat, then:147-148only uses them to initialize recent activity state.src/features/modes/conversation/hooks/autonomous/use-background-autonomous.ts:77scans chats every poll and:108calls the autonomous check for each eligible background chat.Scratch large-profile timing on the current Target 2 batch 4 base, using synthetic JSON collections:
8.87mscold /8.18mswarm,130,221payload bytes.3069.33mscold /2983.80mswarm,101,686,891payload bytes.129.76mscold /128.60mswarm.This makes normal generation, retry, lorebook keeper backfill, and autonomous background checks scale with total transcript size instead of the context window they actually need.
Expected
High-frequency generation and polling paths should not full-read message history by default. Full transcript reads should be reserved for explicit export, branch, summary range, or other workflows that really need all rows.
Suggested Fix
undefinedwhencontextMessageLimitis absent.role,createdAt, andcharacterId.