diegosouzapw/OmniRoute · error · Error
Embedding response missing vector
Error message
Embedding response missing vector
What it means
The embeddings HTTP call returned 2xx, but the parsed JSON body has no data[0].embedding vector. The response body is malformed or shaped differently than the OpenAI-style embeddings schema embedText expects — an unexpected-provider-format condition, not a transport failure (transport failures throw earlier with status/text).
Solutions
- Log the raw response to see which gateway mangled the payload
- Switch to a provider/model that returns a standard embeddings shape
Defensive patterns
Strategy: retry
When it happens
Trigger: Thrown at src/lib/memory/qdrant.ts:301 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25).
Data as JSON: /api/errors/f64194e19ebea49e.
Report an issue: GitHub.
Appendix: source
Thrown at src/lib/memory/qdrant.ts:301
async function embedText(cfg: QdrantConfig, text: string): Promise<number[]> {
const modelStr = cfg.embeddingModel.trim();
if (!modelStr.includes("/")) {
throw new Error(`Invalid embedding model '${modelStr}'. Use provider/model format.`);
}
const res = await createEmbeddingResponse({
model: modelStr,
input: text,
});
if (!res.ok) {
const txt = await res.text().catch(() => "");
throw new Error(txt.slice(0, 300) || `Embeddings request failed (${res.status})`);
}
const data = (await res.json().catch(() => null)) as any;
const vec = data?.data?.[0]?.embedding;
if (!Array.isArray(vec) || vec.length === 0) {
throw new Error("Embedding response missing vector");
}
return vec as number[];
}
export async function upsertSemanticMemoryPoint(input: {
id: string;
apiKeyId: string;
sessionId: string;
key: string;
content: string;
metadata: JsonRecord;
createdAt: string;
expiresAt: string | null;
}): Promise<{ ok: boolean; latencyMs: number; error?: string }> {
const cfg = await getQdrantConfig();
if (!cfg.enabled || !cfg.host) return { ok: false, latencyMs: 0, error: "not_configured" };
const start = Date.now();View on GitHub (pinned to a179ffed5b)