mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #6295] [MERGED] fix: address schedule limits, embeddings, lore and storage #7126
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#7126
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-Engine/pull/6295
Author: @SpicyMarinara
Created: 9/17/2026
Status: ✅ Merged
Merged: 9/17/2026
Merged by: @SpicyMarinara
Base:
staging← Head:fix/6291-6294-issue-sweep📝 Commits (10+)
69f4746fix(lorebook): cascade agent lore when the message it came from is deletedfd96ed6Merge branch 'staging' into fix/lorebook-deleted-message-cascade8e72670chore: start second issue sweep409a323fix: preserve custom limits and scope database validation2dde0f6fix(lorebook): cascade agent lore when the message it came from is deletedcc93a12fix(lorebook): address CodeRabbit review findings on the cascade2909ffffix(lorebook): bind tool writes to saved responses and preserve undo1a34a65Merge contributor provenance review fixes without losing staging changese206b4dfix: reject invalid daily limits before saving or exporting970f2a2Merge lorebook provenance and package tools for integration review📊 Changes
33 files changed (+1837 additions, -142 deletions)
View changed files
📝
CHANGELOG.md(+10 -0)📝
e2e/core-flows.e2e.ts(+28 -0)📝
packages/client/src/components/chat/CharacterScheduleEditorModal.tsx(+19 -11)📝
packages/client/src/components/chat/HomeCreditsModal.tsx(+21 -17)📝
packages/client/src/lib/character-schedule-transfer.ts(+1 -1)📝
packages/client/src/localization/locales/en.json(+2 -1)📝
packages/server/src/db/file-backed-store.ts(+8 -1)📝
packages/server/src/db/schema/lorebooks.ts(+12 -0)📝
packages/server/src/routes/backup.routes.ts(+7 -1)📝
packages/server/src/routes/chats.routes.ts(+16 -0)📝
packages/server/src/routes/generate.routes.ts(+43 -4)📝
packages/server/src/routes/generate/agent-write-approval.ts(+19 -1)📝
packages/server/src/routes/generate/lorebook-keeper-utils.ts(+30 -0)📝
packages/server/src/routes/generate/retry-agents-route.ts(+44 -1)📝
packages/server/src/routes/lorebooks.routes.ts(+16 -3)📝
packages/server/src/services/conversation/autonomous.service.ts(+3 -4)📝
packages/server/src/services/generation/tool-resolution-runtime.ts(+73 -3)📝
packages/server/src/services/lorebook/index.ts(+40 -0)📝
packages/server/src/services/mari-db/mari-db.service.ts(+69 -58)📝
packages/server/src/services/sidecar/sidecar-launch-plan.ts(+10 -1)...and 13 more files
📄 Description
Linked issue
Closes #6298: the final CI run exposed an admitted storage flush racing with shutdown.
Closes #6291, #6293 and #6294. Owner: @SpicyMarinara; implementation by Codex.
Merged into
stagingthrough #6295 at594e9b631, preserving the exact #6289 commits and contributor history. Both PRs passed their required checks and completed GitHub CodeRabbit reviews before merge; the outside contribution had current owner approval. Package tools from #6290 were merged first.Why this change
Character schedules silently capped custom daily limits at eight, and local embedding batches above 2,048 were clamped by llama.cpp's unchanged logical batch. Small Professor Mari edits also validated the entire database repeatedly, permanently loading unrelated lazy tables and reporting plain-text agent memory as invalid JSON.
What changed
Let flushes admitted before shutdown join the existing close drain, while retaining rejection of new writes after close. The shutdown drain preserves admitted write errors even when its retry succeeds.
Include #6289’s message/swipe provenance so discarded turns stop contributing agent lore, with undo, human-edit protection and safe bulk cleanup. Repeated keeper writes retain the original snapshot; legacy profile imports clear foreign message references.
Reuse the schedule editor's numeric-input pattern; blank means Default and invalid fractions/zero receive an explicit validation message. Preserve custom caps through imports and scheduling while retaining the chat-wide cap.
Set both llama.cpp batch sizes, retaining the existing logical default for smaller physical batches.
Validate changed rows and their references before/after edits and undo. Explicit full validation remains available and still reports old broken references. Preserve both text and JSON agent memory without deleting user data.
Validation
Final combined commit
d39ca9aadpassedpnpm checkand 290/290 Node regressions. The behavioral follow-ups passed local CodeRabbit with zero findings. Version and generated contributor-credit checks pass; the launcher format guard verifies both storage-format markers agree.Real-store regressions cover atomic message/lore deletion, partial bulk failure, metadata queue ordering, repeated keeper/tool writes, scoped deletion, human edits, stale vectors, legacy profile imports, repeated query keys and shutdown retries. The added failures were reproduced before their fixes. Bulk cleanup deliberately performs one lore scan per nonempty 500-message chunk to preserve atomicity without a new index.
The schedule flow passes desktop Chromium, mobile Chromium and mobile WebKit, including custom limits, invalid input, import/export, reload and blank Default. All eight Mari suites pass; a small edit no longer loads 19 unrelated lazy tables, while invalid JSON and dangling references remain rejected. Earlier optional browser CI failures were investigated, passed focused local checks, and passed the affected CI jobs on rerun.
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
Manually verify the schedule control in a live chat and local AMD HIP embedding with the reported Gemma model. The automated browser flow covers custom limits, export/import, save/reload and blank Default. Original reporter hardware and database are unavailable.
Docs and release impact
User-facing changes are recorded in CHANGELOG. Storage format 7 protects provenance from older builds that discard unknown columns; app version remains unchanged. Generated contributor credits are refreshed. Package API documentation was merged in #6290; all ten translated packs are in #6297.
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue openedUI evidence (if applicable)
Before/after screenshots: desktop Chromium, mobile Chromium and mobile WebKit, light and dark themes. Download the self-contained HTML gallery to view all twelve original PNG captures. The combined branch passes the schedule browser flow, including invalid input, import/export, save/reload and Default.
Post-merge verification: the fresh staging Node run at
594e9b631passed all 290 regressions, including normal shutdown-test process exit (CI result). An earlier optional combined-PR job completed every shutdown assertion but its process timed out on exit; the other Linux PR run and final combined local run also passed. No assertion or timeout was weakened. The broader post-merge browser matrix is still running.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.