mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #6564] [MERGED] fix(storage): prevent agent history joins from stalling the server #7229
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#7229
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/6564
Author: @SpicyMarinara
Created: 9/23/2026
Status: ✅ Merged
Merged: 9/23/2026
Merged by: @SpicyMarinara
Base:
staging← Head:codex/6562-agent-join-stall📝 Commits (2)
0e4297cdocs: record agent history stall fix for #65624ba242bfix(storage): index agent history joins instead of scanning every row pair📊 Changes
3 files changed (+273 additions, -2 deletions)
View changed files
📝
CHANGELOG.md(+2 -0)📝
packages/server/src/db/file-backed-store.ts(+62 -2)➕
scripts/regressions/store-join-index.regression.ts(+209 -0)📄 Description
Linked issue
Closes #6562
Why this change
With many chats loaded, retrieving an agent's previous output compared every resident agent run with every resident message on the server's main thread. The reporter observed minutes-long stalls that also blocked health and abort requests. The same 5,000-run / 20,000-message query took 19,563 ms locally before this fix and 13 ms afterward.
What changed
The fix is in the shared storage query path used by all six Engine joins. No schema, migration, persistent index, dependency, or UI changes. Original contribution is credited in the commit.
Validation
Completed on head
4ba242b41aff: all 38 current GitHub checks and CodeRabbit passed, including the full Node suite and desktop/mobile browser matrix.pnpm installandpnpm checkpassed./api/generateroute with a local mock provider, 20,000 messages and 5,000 runs across 20 chats: agent received the correct previous output; generation finished in 310 ms; all 11 simultaneous health requests succeeded, maximum 62 ms. This measures local routing/query work, not external model latency./api/healthreturnedokand the matching commit. The first build was interrupted by local disk exhaustion; it completed after removing disposable build artifacts/cache.unsupportedon this macOS host; that code and test are unchanged. The unrelated CLI readback test failed once while parsing generated IDs and passed unchanged on a targeted retry. Hosted Linux Node regressions passed all 359/359 files, including these tests and the new join regression (20 ms for the multi-chat query).Human checklist (left unchecked):
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
Manually verify on the reporter's Termux device that agent generation remains responsive after opening many chats. The original device and private chat data were not available; the reported query and data scale were reproduced with synthetic data. No UI changed.
Docs and release impact
Changelog entry added. No configuration, release-version, storage-format, or translated-guide changes.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.