mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #1189] Avoid duplicate chat message loads in startGeneration #587
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#587
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 (May 25, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1189
Originally assigned to: @cha1latte on GitHub.
Summary
startGenerationcurrently loads chat messages once before committing the visible tracker snapshot, then loads chat messages again immediately afterward for prompt assembly and tracker baseline selection.This works, but it does extra storage work on the generation path. In long chats, that can make generation startup do more message-listing than necessary.
Current behavior
In
src/engine/generation/start-generation.ts, the generation flow:commitVisibleTrackerSnapshotSafely.storedMessages.The second load is still needed when saving the user message changes the timeline, but some paths should be able to reuse already-loaded messages.
Expected behavior
Reuse loaded chat messages when the timeline has not changed, and reload only when saving a user message actually changes the message list.
Suggested implementation
Keep the change scoped to
startGeneration:saveUserMessageonly when a saved user message changes the timeline.Why this matters
This is a cleanup/performance chore, not a known correctness bug. It reduces repeated storage reads in the generation startup path and makes the tracker snapshot flow easier to reason about.
Verification
Suggested checks for the eventual PR:
pnpm typecheck@cha1latte commented on GitHub (May 25, 2026):
Closed in #1197