mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #7432] [MERGED] fix(capability): forward the embedding input type from packages #7730
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#7730
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/7432
Author: @SpicyMarinara
Created: 10/11/2026
Status: ✅ Merged
Merged: 10/11/2026
Merged by: @SpicyMarinara
Base:
staging← Head:fix/capability-embed-input-type📝 Commits (3)
8ba43bafix(capability): forward the embedding input type from packages5567be4docs(capability): name Snowflake Arctic Embed v2 as a query-prefix model22dcdf0test(capability): cap the embedding fixture's request body📊 Changes
7 files changed (+117 additions, -11 deletions)
View changed files
📝
CHANGELOG.md(+1 -0)📝
docs/development/optional-agent-packages.md(+24 -3)📝
packages/server/src/services/capability-packages/capability-embedding.service.ts(+3 -2)📝
packages/shared/src/schemas/capability-package.schema.ts(+4 -1)📝
packages/shared/src/types/capability-runtime.ts(+5 -1)➕
scripts/regressions/capability-embedding-input-type.regression.ts(+76 -0)📝
scripts/regressions/capability-package-lifecycle.regression.ts(+4 -4)📄 Description
Linked issue
Closes #7429
Thanks to @Promansis for the report, the code trace and the minimal fix this PR follows.
Why this change
source.embed(texts, signal), so the memory-recall source defaulted every text to"document".passage:instead ofquery:on e5 / multilingual-e5,search_document:instead ofsearch_query:on nomic-embed-text, and no prefix instead ofquery:on Snowflake Arctic Embed v2. Recall is weaker, silently, in any language. The Engine's own chat memory recall already passes the input type; only the package path lost it.What changed
CapabilityEmbeddingHost.embed(texts, signal?, inputType?)inpackages/shared/src/types/capability-runtime.tstakes an optional third positional argument,"query" | "document".capability-embedding.service.tsforwards it asinputType === "query" ? "query" : "document", so anything other than"query"stays a document, as before.all-MiniLM-L6-v2is on the plain profile (no query or document prefix), and the Engine's own memory recall also calls the local embedder without an input type.AbortSignal.any([signal, timeoutSignal])), so{ signal, inputType }would throw there, while an extra positional argument is ignored. Packages can pass it without a version gate.spaceIddoes not change and nothing needs re-embedding: stored vectors were embedded as documents and stay documents.openCharacterwas a soft seam with its own bump too). It is a soft seam: packages do not need to declare 1.68. The version-history comment incapability-package.schema.tsand the version pins incapability-package-lifecycle.regression.tsmove with it.docs/development/optional-agent-packages.md: the 1.15 section now listsembed(texts, signal?, inputType?), and a new Capability API 1.68: embed search queries as queries section explains the argument, the default and why it is positional. It names the prefix models as the Engine resolves them inresolveMemoryRecallEmbeddingInputProfile: e5 and nomic-embed-text prefix both queries and documents, Snowflake Arctic Embed v2 prefixes only queries, and the rest, including MiniLM, get no prefix.scripts/regressions/capability-embedding-input-type.regression.ts: a configured connection withintfloat/multilingual-e5-largeagainst a local fixture endpoint;"query"sendsquery: …, and the default and"document"sendpassage: …. It fails onstaging(the query is sent aspassage: Where is the lighthouse?) and passes with this change.CHANGELOG.mdentry under[Unreleased].Package-side follow-up
This PR only changes the Engine host. Long-Term Memory itself must pass
"query"for its recall queries, which is tracked in the package repository: Pasta-Devs/Marinara-Agents#1302. Until that ships, LTM's behavior does not change.Validation
pnpm checkpasses locallyCONTRIBUTING.mdCommands the agent ran locally (results as reported by the commands, not a substitute for the boxes above):
pnpm check: exit 0node ./scripts/run-regressions.mjs --filter scripts/regressions/capability-embedding-input-type.regression.ts: passed; with the host change stashed it failed as expectednode ./scripts/run-regressions.mjs --filterforcapability-package-lifecycle,capability-package-chat-controls,memory-recall-revectorize,semantic-summary-settingsandprompt: each passednode ./scripts/run-regressions.mjs --filter capability: 19/19 passedcoderabbit review --agent --committed --base-commit $(git merge-base HEAD origin/staging): review completed with 0 findings, so nothing was rejectedpnpm checkexit 0 again, andcapability-embedding-input-type,capability-package-lifecycle,memory-recall-revectorize,semantic-summary-settingsandprompteach passed againReview follow-up
query:on queries (resolveMemoryRecallEmbeddingInputProfile,packages/server/src/services/memory-recall-embedding.ts). The section now names it as a query-only prefix model. This is a wording fix to docs only; the behavior it describes is already pinned by the Snowflake v2 query/document assertions inscripts/regressions/prompt.regression.ts, so no new regression was added. Local CodeRabbit was not re-run for this docs-only wording change.Manual verification notes
intfloat/multilingual-e5-large(ornomic-embed-texton Ollama) and a package that callsembeddings.embed([query], signal, "query"): the embeddings endpoint log or a proxy shows the query starting withquery:(search_query:for nomic), and stored texts still starting withpassage:(search_document:). With a Snowflake Arctic Embed v2 model, the query starts withquery:and stored texts have no prefix."query".Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)docs/development/optional-agent-packages.mdexists in every translation pack ondocs-i18n; the follow-up issue is #7433. No app version bump; the capability API minor moves to 1.68.UI evidence (if applicable)
No UI changes.
Summary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.