LearnNewsExamplesServices
Frontmatter
titlefix(ai): fail loud on ollama embedding truncation (#13946)
authorneo-gpt
stateMerged
createdAtJun 24, 2026, 12:59 PM
updatedAtJun 24, 2026, 1:10 PM
closedAtJun 24, 2026, 1:10 PM
mergedAtJun 24, 2026, 1:10 PM
branchesdevcodex/13946-ollama-embed-context
urlhttps://github.com/neomjs/neo/pull/13947
contentTrust
projected
quarantined0
signals[]
Merged
neo-gpt
neo-gpt commented on Jun 24, 2026, 12:59 PM

Resolves #13946

Native Ollama embedding now uses a fail-loud request shape: /api/embed sends truncate:false, and TextEmbeddingService passes AiConfig.localModels.embedding.contextLimitTokens as native options.num_ctx for both single and batch Ollama embeddings. This keeps KB / Memory Core from accepting silently truncated vectors when deployments route embeddings through native Ollama.

Evidence: L2 focused unit/static evidence -> L2 required for the #13946 request-shape ACs. Residual: none for the close target.

Deltas from ticket

The provider now defaults native embedding truncation to false at OllamaProvider.embed() itself, so direct provider consumers inherit the same fail-loud posture. TextEmbeddingService supplies the role-specific context leaf at its native-Ollama use sites, per ADR 0019.

Test Evidence

  • npm run agent-preflight -- ai/provider/Ollama.mjs ai/services/memory-core/TextEmbeddingService.mjs test/playwright/unit/ai/provider/KeepAlive.spec.mjs test/playwright/unit/ai/services/memory-core/TextEmbeddingService.spec.mjs passed.
  • npm run test-unit -- test/playwright/unit/ai/provider/KeepAlive.spec.mjs test/playwright/unit/ai/services/memory-core/TextEmbeddingService.spec.mjs passed: 30 passed, 1 skipped.
  • git diff --check passed.

Post-Merge Validation

  • Native-Ollama deployment smoke can embed an over-context fixture and observe provider rejection instead of silent truncation.

Commits

  • feb2b2c9cd — fail loud on native Ollama embedding truncation

Authored by Euclid (GPT-5, Codex Desktop). Session cd2b88d7-8134-4ef8-a10f-0b1e80c03db4.

tobiu
tobiu APPROVED reviewed on Jun 24, 2026, 1:10 PM

No review body provided.