mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #2664] [Issue]: Inherited embed() always uses OpenAI-style Bearer auth → Anthropic/Google embedding sources fail silently #1314
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#1314
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 @kolacheee on GitHub (Jun 20, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2664
Originally assigned to: @SpicyMarinara on GitHub.
Summary
The inherited default
embed()always uses OpenAI-style Bearer auth and an/embeddingspath/body, so using an Anthropic or Google connection as the embedding source (e.g. for memory recall) sends an auth scheme/endpoint those providers don't accept, failing silently and degrading retrieval.Expected behavior
Embedding requests should use the auth scheme and endpoint appropriate to the connection's provider, or fail with a clear "this provider doesn't support embeddings via this path" error.
Actual behavior
BaseLLMProvider.embed()hardcodesAuthorization: Bearer <key>and POSTs to<baseUrl>/embeddingswith an OpenAI-style body.AnthropicProviderandGoogleProviderdon't override it, and their auth isx-api-key/x-goog-api-key(Google can also use a query-param key) with different embeddings paths/bodies. When such a connection is the embedding source, the request goes out with the wrong scheme/path, returns 401/404, is caught, logged aswarn, and returnsnull— silently degrading recall.How it breaks the pipeline
Code trace (staging @
b826f8f4):packages/server/src/services/llm/base-provider.ts:626–643— hardcodedAuthorization: Bearer ${this.apiKey}+POST ${this.baseUrl}/embeddings.AnthropicProvider/GoogleProviderdo not overrideembed(); their auth headers differ (anthropic.provider.ts:280/:437x-api-key;google.provider.ts:140/:407/:567x-goog-api-key).resolveMemoryRecallEmbeddingSource(packages/server/src/services/memory/memory-recall-embedding.ts) builds the provider viacreateLLMProviderand callsprovider.embed()with no provider gating; failures are caught →warn→null.Steps to reproduce
{baseUrl}/embeddingswith aBearerheader; Google/Anthropic reject it (401/404); recall silently returns nothing (only a serverwarn).Suggested fix
Override
embed()in providers whose auth/endpoint differ, or guard the defaultembed()to run only for OpenAI-compatible provider kinds and otherwise throw a clear "embeddings not supported via this provider/path" error so the misconfiguration is visible to the user.Environment
b826f8f4)Additional context
Identified via systematic source review on staging (refs @
b826f8f4). Low severity (affects only non-OpenAI embedding sources) but fails silently, so retrieval quality degrades with no user-visible cause. Filed alongside related pipeline issues.Template check
Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:
@SpicyMarinara commented on GitHub (Jun 20, 2026):
Implemented on branch codex/spicymarinara-assigned-issues: Anthropic and Gemini providers now reject inherited OpenAI-style embedding calls with a clear unsupported-provider error. Final validation will run after the full assigned sweep per maintainer request.