mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #7630] [MERGED] fix(lorebooks): vectorize through the connection's Embedding Connection #7845
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#7845
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/7630
Author: @ylli-selmani
Created: 10/14/2026
Status: ✅ Merged
Merged: 10/14/2026
Merged by: @ylli-selmani
Base:
staging← Head:fix/lorebook-vectorize-embedding-connection📝 Commits (3)
0c083ccfix(lorebooks): vectorize through the connection's Embedding Connectionb49a178fix(lorebooks): list Embedding Connection borrowers in the Vectorize picker01ca1fdfix(lorebooks): clearer error when no embedding source resolves📊 Changes
3 files changed (+110 additions, -46 deletions)
View changed files
📝
packages/client/src/components/lorebooks/LorebookEditor.tsx(+11 -4)📝
packages/server/src/routes/lorebooks.routes.ts(+32 -41)📝
scripts/regressions/lorebook-vectorization.regression.ts(+67 -1)📄 Description
Requested by Ylli
Linked issue
Closes #7628
Why this change
resolveMemoryRecallEmbeddingSource, the same resolver chat-time matching uses, so the override's key, base URL and (when it has one) embedding model are used, and the stored space id matches the one queries are checked against.What changed
POST /lorebooks/:id/vectorize(packages/server/src/routes/lorebooks.routes.ts) builds its remote source withresolveMemoryRecallEmbeddingSourceinstead of its owncreateLLMProvidercall. TheembeddingSpaceIdand the input-profile formatting now come from that source. The Local Model (sidecar) path is unchanged.modelsent by the client is still accepted (the current client sends one) but ignored. A connection with no embedding model on itself or its Embedding Connection now gets a 400 with a message saying where to set one, instead of embedding with the client-sent model.LorebookEditor.tsx) also lists connections that have an Embedding Connection but no embedding model of their own, shows the model in the option label only when the connection has one, and no longer sendsmodel.scripts/regressions/lorebook-vectorization.regression.tsgains a second fake provider standing in for an Embedding Connection. It asserts Vectorize sends the request there and not to the chat connection's endpoint, that the stored space id equals the oneresolveMemoryRecallEmbeddingSourcegives for chat-time queries, and that a connection with no embedding model is refused. Before the fix, the override assertion failed (the request went to the chat connection's endpoint).How this relates to #7627: that PR adds an app-wide default embedding source inside
resolveMemoryRecallEmbeddingSource. Since Vectorize now goes through that resolver, the default will apply to vectorizing too, with no extra change here. This PR does not touchmemory-recall-embedding.ts. Both PRs edit the Vectorize picker inLorebookEditor.tsx: this one changes the list filter and option label, #7627 changes the initial selection, so expect at most a small textual overlap.Validation
pnpm checkpasses locallyCONTRIBUTING.mdAgent-run results (boxes above left for the contributor):
pnpm checkexit 0. In a dev build, a "Borrower" connection with no embedding model and an Embedding Connection pointing at a local fake embedding server (its own base URL pointing at nothing) now appears in the picker, and vectorizing with it embedded both entries through the override (/v1/embeddings, modeltest-embed). Regressions passing:lorebook-vectorization,memory-recall-revectorize,capability-embedding-input-type,entity-embedding-store.Local CodeRabbit: 1 minor finding, dismissed. It asked for body-size and batch limits on the regression's second fake embedding server. That server binds to 127.0.0.1 on an ephemeral port for the life of one regression run, mirrors the existing fake server in the same file, and only receives requests from the route under test, so the limits would add code without protecting anything.
Manual verification notes
Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)docs/lorebooks/semantic-search.mdis being rewritten in #7627's docs slice, which is the natural place to describe the Embedding Connection behavior.UI evidence (if applicable)
Picker now lists the borrower connection; screenshot shared in the project thread.
🤖 Generated with Claude Code
Summary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.