Skip to content

fix: back off ollama embedding truncation retries#82

Merged
Helweg merged 2 commits into
mainfrom
fix/ollama-embedding-fallback-backoff
May 13, 2026
Merged

fix: back off ollama embedding truncation retries#82
Helweg merged 2 commits into
mainfrom
fix/ollama-embedding-fallback-backoff

Conversation

@Helweg
Copy link
Copy Markdown
Owner

@Helweg Helweg commented May 13, 2026

Summary

Improve the Ollama embedding fallback path so context-length failures keep backing off instead of relying on a single optimistic truncation retry.

Changes

  • replace the one-shot Ollama truncation retry with progressive fallback candidates in src/embeddings/provider.ts
  • add provider-level regression coverage for near-limit and repeated context-length retry scenarios in tests/custom-provider.test.ts
  • add indexer-level regression coverage proving split Ollama chunks recover without leaving failed batches in tests/indexer-failed-batches.test.ts

Testing

How were these changes tested?

  • Unit tests added/updated
  • Manual testing performed
  • Build passes (npm run build)
  • Typecheck passes (npm run typecheck)
  • Tests pass (npm run test:run)
  • Lint passes (npm run lint)

Release Labels

  • Added at least one release category label (feature, bug, performance, documentation, dependencies, refactor, test, chore, or skip-changelog)
  • Added at most one semver label (semver:major, semver:minor, semver:patch) when needed

Related Issues

Fixes #79

@Helweg Helweg added bug Bug fix test Test changes semver:patch Bug fix or patch labels May 13, 2026
@Helweg Helweg merged commit 705b075 into main May 13, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Bug fix semver:patch Bug fix or patch test Test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: opencode 守护进程因 usearch index remove 死循环导致 100% CPU 持续空转

1 participant