mirror of
https://github.com/HKUDS/DeepTutor.git
synced 2026-12-02 00:39:47 +08:00
dev
21 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
1a6ec58a10 | fix(embedding): reject multimodal vector width changes across batches | ||
|
|
259bb43e3d |
fix: embedding local keyless, qwen3-Instruct thinking, embedding concurrency (#1797)
* fix(embedding): do not serialize requests when batch delay is zero The spacing lock was held around every embedding HTTP call, so concurrent indexing stayed serial even when batch_delay was 0. Fixes #1779 * fix(embedding): treat LAN Lemonade endpoints as keyless local servers OpenAI-compatible profiles pointed at a private Lemonade port were still required to have an API key, so LlamaIndex knowledge bases failed to initialize. Fixes #1782 * fix(reading): keep headings that follow fenced code examples The reader treated any line starting with the fence character as a toggle, so an example fence swallowed every later heading. Fixes #1641 * fix(learning): hide surfaces a learner account cannot use The auth status already returned the learning policy, but the sidebar ignored it, and model options answered 403 for those accounts. Fixes #1222 * fix: three bug fixes - embedding local keyless, qwen3-instruct enable_thinking, embedding concurrency lock - fix #1782: embedding resolver now applies sk-no-key-required fallback for local providers (vllm/ollama/lemonade) matching the LLM resolver behavior; also detects local base URLs before returning 'custom' hint so keyless local endpoints (e.g. Lemonade Server on localhost) are classified as local - fix #1796: exclude -Instruct model variants from qwen3 enable_thinking pattern matching; Qwen3-Instruct/Qwen3-VL-Instruct models reject enable_thinking parameter (provider error 20015) - fix #1779: global spacing lock no longer held across HTTP embed calls when batch_delay=0, restoring concurrent embedding; lock now only guards the minimum-interval wait and timestamp update; removed redundant post-batch delay; applied same fix to embed_contents * fix(reading): respect fence indentation and verify learner navigation * fix(embedding): share start pacing without serializing requests * fix(embedding): preserve local endpoint protocols across inference --------- Co-authored-by: Rockynowzzz <198366628+Rockynowzzz@users.noreply.github.com> Co-authored-by: dajiaohuang <dajiaohuang@users.noreply.github.com> Co-authored-by: Bingxi Zhao (Frank) <13051345080@163.com> |
||
|
|
45bece1b40 |
fix: embedding concurrency, local Lemonade, reading fences, and learner nav (#1783)
* fix(embedding): do not serialize requests when batch delay is zero The spacing lock was held around every embedding HTTP call, so concurrent indexing stayed serial even when batch_delay was 0. Fixes #1779 * fix(embedding): treat LAN Lemonade endpoints as keyless local servers OpenAI-compatible profiles pointed at a private Lemonade port were still required to have an API key, so LlamaIndex knowledge bases failed to initialize. Fixes #1782 * fix(reading): keep headings that follow fenced code examples The reader treated any line starting with the fence character as a toggle, so an example fence swallowed every later heading. Fixes #1641 * fix(learning): hide surfaces a learner account cannot use The auth status already returned the learning policy, but the sidebar ignored it, and model options answered 403 for those accounts. Fixes #1222 * fix(github-source): refresh unchanged sync state (#1490) * test: freeze naive FIXED_NOW for cross-platform TZ stability (#1733) * test: pin TZ in runtime_context date assertions for cross-timezone stability * test: freeze naive FIXED_NOW for cross-platform TZ stability Rework of |
||
|
|
cc373762e4 |
fix(rag): log swallowed embedding/image progress and LightRAG meta failures (#1703)
* fix(embedding): log progress callback failures instead of swallowing them embed/embed_contents wrapped progress_callback in 'except Exception: pass'. A failing progress sink vanished without a trace while indexing continued, making KB index progress untrustworthy (stalled reads with no diagnostics). Keep the callback best-effort (embedding runs must not fail on UI feedback) but log a warning with batch context and the underlying exception. * fix: log image progress callback failures instead of swallowing them _describe_one wrapped image_progress_callback in 'except Exception: pass', so a broken progress sink silently dropped indexing progress updates with no trace. Log a warning with completed/total context and keep the batch running; add a focused test covering visible failure logging and uninterrupted loading. * fix(lightrag): warn when workspace meta.json exists but is unusable workspace_for() swallowed OSError/ValueError when reading meta.json and silently fell back to the path-hash workspace name, which can open an empty store with no log trail. Missing files stay silent; unreadable or corrupt meta now logs a warning with the path and exception type while keeping the same fallback behavior. * test(codebuddy): make credential fixture expiry relative to now test_load_credentials_parses_session wrote a hard-coded expiresAt of 1791055241000 (2026-10-03 15:40:41 UTC) and asserted is_expired() is False. Once that instant passed the assertion flipped, so the test now fails on every Python version for every branch. Derive expiresAt / refreshExpiresAt from time.time() so the fixture always describes a live session, and assert against the value written. --------- Co-authored-by: XZH <cto@xzh.ai> |
||
|
|
da856ad670 |
release: v1.6.9
Ship folder-based workspaces and data migration, daily practice, redesigned provider and model settings, and streaming conversation improvements. Synchronize README translations and document the archive/permanent-delete upgrade behavior in assets/releases/ver1-6-9.md. Reduce initial JavaScript by deduplicating English resources and loading animation features after hydration. Keep the existing route size budgets. Update regression fixtures and browser audits for scoped URLs and the new settings and learning interfaces. |
||
|
|
1203141f63 | fix: avoid blocking the embedding event loop | ||
|
|
1625cdd105 |
fix(embedding): survive provider rate limits — key rotation, retry budget, global throttle (#962)
* T028(Codex交付,ZC核验代提交): KeyPool多key轮换层(provider×model×key池·429冷却·单key兼容) · api_key/api_token字段兼容数组 · 三处接入(embedding/mineru/llm) · 图片描述gather+Semaphore并发化 · 303单测全过(含官方既有测试回归)
* FIX-EMB-429: 火山embedding 429根治(上游PR候选) · ①429重试按Retry-After等30s(滑窗等过) ②resolver从profile读batch_size/batch_delay(火山RPM极低必须限速) · 实测batch5/delay2s下语文reindex突破processing · 三key池x2冷却机制已验
* HARDEN-429: embedding限流重试1→8次+全冷却等待65s再取 · 单key池滑动窗口瞬时429不再报废数小时reindex整跑(08-22三烧教训) · 月度额度429仍8轮后raise不空转
* FIX-UNBOUND: 限流重试槽位for耗尽静默穿落到data引用 · 槽位1+max(MAX_RETRIES,10)兜住8轮限流 · t035镜像UnboundLocalError根因(逻辑走查复现)
* THROTTLE-GLOBAL: embedding跨实例全局节流锁 · 类级锁串行化'间隔+发帖'(多文档并行reindex各自client叠加超RPM=08-22历史库六烧终根因) · batch_delay升级为全局最小间隔 · 手动单发200而进程内全429的分歧由此闭合
* FIX-LOCK: 节流锁asyncio→threading · LlamaIndex _run_in_new_loop每线程新event loop,asyncio.Lock绑创建loop跨loop不互斥(根因三层剥洋葱终层) · 静态方法装饰修正 · 容器内3线程串行化实测2.01s通过
* PR-PREP: 中性化 fork 痕迹注释(中文→英文 provider 通用表述) · 上游v1.5.16已有_as_api_key数组支持,删我方重复实现保留上游版 · 测试148+86全过 · 密钥扫描分支历史+工作树双清(A类指纹0命中,B类28处=上游自带fixture)
* LINT: ruff format 6文件对齐CI(上游基线0债,全是我方引入) + import顺序修正
* FIX-CI: 图片处理块整体采纳上游v1.5.16版(_describe_image新签名+批量embed_contents) · 删越域的fork逐图并发测试(记档将来独立PR) · 592测全过
* FIX-CI: _build_openai_client合并壳与实现(上游sanitize保留+key池数组兼容) · placeholder_key改用primary_key(list哈希修复) · 889测全过
* fix(keypool): never refuse the only key
`KeyPool` is built even for a single-key config, and `next()` raised
`RuntimeError("All API keys are cooling down")` once every key was cooling.
For the common one-key setup that meant two 429s took every LLM and embedding
call down for the full 60s window — and it bypassed the rotation layer's own
429 handling entirely, since the RuntimeError surfaces before
`_KeyRotatingCompletions.create` can mark the strike and re-raise the real
provider error. `sdk_max_retries=0` had already handed retry duty to that
layer.
Cooling is a preference hint, not a circuit breaker: when everything is
cooling, return the key that recovers soonest and let the provider's own 429
surface to be retried.
The existing single-key test asserted the raise while calling itself
"keeps single key compatible" — it now pins the behaviour the name promises,
plus the soonest-recovery ordering for the multi-key case.
---------
Co-authored-by: interia <interia@interiadeMac-mini.local>
Co-authored-by: Frank <bingxizhao@novix.science>
|
||
|
|
2ad3640cd1 |
feat(embedding): support Gemini Embedding 2 over the native API (#744)
Adds a Gemini embedding adapter that speaks the native :batchEmbedContents endpoint, so Embedding 2's retrieval-role prompt instructions and configurable output dimensionality are available, and threads a retrieval role (query vs document) from both RAG pipelines down to the client. The role is opt-in per adapter: Jina and the OpenAI-compatible backends keep sending exactly what they sent before, because adding a task hint changes the vectors and would invalidate indexes already built. For the same reason only Embedding 2 defaults to the native endpoint — an existing gemini-embedding-001 profile stays on the OpenAI-compatible path unless its endpoint is set to the native URL explicitly. Also redacts credential-like query parameters from endpoint values shown in errors and diagnostics. |
||
|
|
1596807242 | refactor chat capability & RAG pipeline(llamaindex) | ||
|
|
3d5c3a1eb5 | improve chat | ||
|
|
824bf778df | fix: lint & logging system | ||
|
|
a069b6ebf0 |
chore: prepare v1.3.2 release
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 |
||
|
|
28e225ee0e |
chore: prepare v1.3.1 release
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 |
||
|
|
7fce54d98a |
chore: prepare v1.3.0 release
Made-with: Cursor |
||
|
|
2c39eb4fc9 |
feat(embedding): tri-state send_dimensions toggle (UI + env + catalog)
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 |
||
|
|
77f29cbcc7 | fix lint | ||
|
|
9544075d60 |
v1.1.0-beta
URL-based chat routing, Snow theme, WebSocket heartbeat & auto-reconnect, ChatComposer perf optimization, embedding provider registry overhaul, Serper search provider, streaming idle timeout, and expanded test suite. Made-with: Cursor |
||
|
|
0950c98e18 |
fix: merge PR #268 (embedding progress + 429 retry) with review fixes
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 |
||
|
|
9e8cea8294 | fix: update embeddings config & provide perplexity search | ||
|
|
f3779138ae | fix: remove lightrag and unify llm & search config | ||
|
|
9c18bf0705 | codebase cleanup and decoupled, introduce cli operation |