Embedding endpoint URLs are now transparent end-to-end: Settings shows the
exact URL DeepTutor will POST to, legacy `/v1`-style bases are migrated to
full `/embeddings` / `/api/embed` URLs, the embedding client rejects
known-provider misconfigurations early, and OpenRouter routes through the
same exact-URL HTTP adapter as other providers.
LlamaIndex RAG now refreshes embedding state before initialize/search/add,
validates persisted vectors before retrieval, and reports invalid indexes
with `needs_reindex: true` instead of raw NumPy/`NoneType` errors.
Memory refresh strips `<think>` / `<thinking>` blocks from reasoning-model
output before writing PROFILE.md / SUMMARY.md, and existing memory files
self-repair on read.
Also fixes a Deep Solve runtime regression where `MainSolver` still passed
a stale `attachments` keyword to `SolverAgent.process()`.
Adds release notes (assets/releases/ver1-3-2.md) and updates README.
Made-with: Cursor
Stability release after v1.3.0 covering safer RAG/KB routing, stronger
embedding validation, more reliable Docker/TutorBot restarts, Web UX
fixes, and Windows/encoding hardening. See assets/releases/ver1-3-1.md
for the full notes.
Made-with: Cursor
Generalises #368: adds an explicit per-model `send_dimensions` opt-in
exposed as a Settings UI toggle and an EMBEDDING_SEND_DIMENSIONS env var.
Tri-state semantics:
true -> always send (user knows their provider supports it)
false -> never send (e.g. Qwen text-embedding-v4 via litellm gateway
which returns HTTP 400 when `dimensions` is sent)
unset -> fall back to the text-embedding-3* heuristic from #368
Backend:
- Adapter base accepts `send_dimensions`; OpenAI-compatible adapter
decides via `_should_send_dimensions(model)` (replaces the hardcoded
startswith check from #368).
- ResolvedEmbeddingConfig / EmbeddingConfig carry the flag through.
- EnvStore reads/writes EMBEDDING_SEND_DIMENSIONS, dropping the line
entirely when empty so legacy `.env` files keep the Auto behaviour.
- ModelCatalogService syncs the flag from .env back into the catalog.
Frontend:
- Settings page shows a "Send dimensions" checkbox next to Dimension,
with an instant CSS-only info tooltip (replaces native `title` to
avoid the browser's ~1s delay). Disabling the toggle greys out the
Dimension input.
- New models default to send_dimensions=true.
- en/zh i18n strings added.
Tests (46 new cases, including the unit tests #368 marked added but
did not actually ship):
- adapter `_should_send_dimensions` tri-state + parametrized non-3 family
- httpx-mocked payload assertions for all four combinations
- runtime resolver: catalog wins over env, garbage values -> None
- env_store helpers + render_from_catalog + write skip-empty round-trip
- EmbeddingClient propagates the flag to the adapter config dict
Made-with: Cursor
The embedding adapter's retry mechanism was missing httpx.ConnectError,
causing immediate failure instead of retry when network connectivity
issues occur (e.g., TLS handshake failures, proxy connection issues).
This fix ensures that transient connection errors are retried with
exponential backoff, improving reliability during knowledge base
initialization.
Fixes#346
When an embedding provider returns null for a chunk's embedding vector,
the None value gets stored in the vector index and causes a TypeError
in LlamaIndex's similarity computation (np.dot with NoneType).
Two-layer fix:
1. _extract_embeddings_from_response: use 'or []' instead of
get(key, default) so explicit None values are caught.
2. CustomEmbedding._get_text_embeddings: validate the batch result
and replace any None vectors with zero vectors.
Co-authored-by: kagura-agent <kagura-agent@users.noreply.github.com>
Merge oxkage's embedding progress tracking and HTTP 429 rate limit
retry (PR #268), with the following review-driven improvements:
- Restore default batch_size=10 and request_timeout=60 to avoid
performance regression for non-free-tier users
- Promote batch_delay to EmbeddingConfig (was private adapter attr)
so all adapters respect user configuration instead of hardcoded 0.5s
- Use set_progress_callback() on existing embed model instead of
creating a new CustomEmbedding instance (avoids global state mutation)
- Clean up progress callback in finally blocks to prevent leaking
into subsequent search/query calls
- Wire progress_callback through add_documents (not just initialize)
- Remove dead HTTPStatusError 429 branch (already handled before
raise_for_status)
- Remove unused total_docs variable in initializer
Made-with: Cursor