261 Commits

Author SHA1 Message Date
Jaeheon Kim
049a59123d fix(i18n): accept Korean as a backend interface language (#2785)
* fix(i18n): accept Korean as a backend interface language

The web picker offers Korean (added in #2359), but the backend UiLanguage
contract, its normalizers and the settings spec never learned "ko". Choosing
Korean and applying settings therefore fails with HTTP 422 on
PUT /api/settings/ui, and the saved language falls back to English on the
next load.

Register "ko" in the same seams Japanese used in #2213: UiLanguage and
_normalize_language() in interface_settings.py, the launch-settings
normalizer, and _LANGUAGE_CHOICES in settings_spec.py, then regenerate the
frontend API contracts. Add Korean to the existing router and launch-settings
tests, and add a registry test that fails whenever a web APP_LANGUAGES code
is missing from the backend contract.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* style: apply ruff format

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 20:00:02 +08:00
Tazeem
72ae8d4703 fix(config): use selected provider protocol after moving a model (#2759) 2026-12-01 13:55:14 +08:00
iQuantum
984260b3f5 fix(imagegen): prefill image models the providers still serve (#2904)
* fix(imagegen): prefill image models the providers still serve

The OpenAI image provider prefilled gpt-image-1, which OpenAI retired on 2026-10-23, and OpenRouter prefilled google/gemini-2.5-flash-image-preview, which OpenRouter no longer lists, so a user who kept the prefill got a failing first request. They now prefill gpt-image-2 and google/gemini-3.1-flash-image.

* fix(imagegen): prefill gpt-image-2.6-flare instead of gpt-image-2

OpenAI shuts gpt-image-2 down on 2027-02-10 and names gpt-image-2.6-flare or -sunburst as the replacement; its image guide recommends the 2.6 models for new integrations. Flare is the general, fast-iteration model and uses the same Images API, so the OpenAI prefill moves to it now instead of to another retiring model.
2026-12-01 11:24:22 +08:00
lipeh1
681b23766f feat(rag): support local rerankers for LightRAG queries (#3009)
* feat(rag): support local rerankers for LightRAG queries

Allow administrators to select a cross-encoder alongside the native LightRAG role models. Run scoring in a reusable worker and partition cached answers by reranker so model changes take effect on existing indexes.

Refs #2701

* fix(api): refresh the router index for LightRAG settings

* fix(rag): run LightRAG reranking in the shared reranker worker

anyio's process pool re-runs the server's __main__ file by path. When the
backend runs as `python -m deeptutor_cli.main serve` (the desktop app),
that file's relative imports fail, so every rerank call failed with
'Error during worker process initialization' and LightRAG silently kept
the original chunk order. Reuse the python -m reranker worker that the
LlamaIndex pipeline already uses.

---------

Co-authored-by: lipeih <lipeihan@eazytec.com>
Co-authored-by: zszz3 <zszz3@users.noreply.github.com>
2026-11-30 18:46:49 +08:00
qiuqianyi66
32acc5889a fix(settings): answer 404 for unknown connection-test run ids (#2841)
* fix(settings): answer 404 for unknown connection-test run ids

* chore(api): refresh router index for the settings route change

tests/api/test_router_loader.py::test_repository_index_matches_router_sources
checks the fingerprint of router sources; regenerated with
scripts/build_router_index.py.

---------

Co-authored-by: zszz3 <91608029+zszz3@users.noreply.github.com>
2026-11-28 20:05:55 +08:00
Leoy
d8f678d04f fix(config): keep a settings document that cannot be parsed instead of resetting it (#2929)
* fix(config): keep a settings document that cannot be parsed instead of resetting it

* fix(config): re-warn about an unparseable settings document once a minute

The startup load runs before logging is configured, so its only record can
reach just the process output, and the permanent per-path set meant it never
appeared in the application log afterwards. Throttle per path instead, and
state in the containerization guide where the warning is written and that
the loader only preserves documents it cannot parse.
2026-11-28 19:42:21 +08:00
wojiecihuo
651a616b02 fix(visualize): raise the budget to 32k, cap it to the model, and retry without thinking (#3019)
* fix(book): retry an interactive page with thinking off when it runs out of room

deepseek-flash thinks by default and can spend the whole 16000-token
visualize budget on reasoning, so a book interactive block came back with
no code. When the page is empty or cut off before </html>, ask once more
with thinking turned off (thinking_off_effort_for) before failing. If that
still runs out of room, the error names the budget sent to the model and
the settings that change it.

The shipped default stays at 16000: the budget is shared by every visualize
caller, and 32768 breaks models with a lower output cap (#3018).

Refs #3011

* fix(llm): raise the visualize budget to 32k and cap each request to the model

A thinking model can spend 16k tokens before it writes any code, so the
visualize default is now 32768. Sent unchanged that would be rejected by
models whose output stops lower (gpt-4o and gpt-4o-mini at 16384) and could
overflow a small local context window, so every request now carries
min(budget, the model's known output limit, half the configured context
window). The cap lives in get_token_limit_kwargs, so it applies to every
caller; BaseAgent and the agentic loop pass the configured window.
2026-11-27 22:26:59 +08:00
OrdoAbChao
22399efcc2 Revert "fix(visualize): give reasoning models room and say how to fix an empty page (#3012)" (#3018)
This reverts commit 0f76dc080e.
2026-11-27 17:58:43 +08:00
wojiecihuo
0f76dc080e fix(visualize): give reasoning models room and say how to fix an empty page (#3012)
deepseek-flash thinks by default and spent the whole 16000-token visualize
budget on reasoning, so book interactive blocks came back with no code.
Raise the default to 32768 and make the book's interactive errors name the
two settings that fix it: Max tokens under Settings -> Capabilities ->
Visualize, or turning off thinking for the model.
2026-11-27 17:51:31 +08:00
游标卡尺
69acdbd316 fix(math_animator): make the code-repair deadline configurable (#2790)
* fix(math_animator): make the code-repair deadline configurable

The render-fix loop's overall repair timeout was fixed at 180s: run_render
built CodeRetryManager without passing repair_timeout_seconds, so the knob
existed on the manager but was unreachable from settings. A long reasoning
model repairing a book animation was cancelled mid-edit at that ceiling with
no way to raise it (#2767).

Lift the deadline into a runtime setting capabilities.math_animator.repair_timeout
in main.yaml, read once in run_render through a get_math_animator_params getter
that shares the UI's coerce/clamp path. The single read site covers all three
callers (math_animator capability, visualize Manim route, book AnimationGenerator),
and an in-flight render keeps the value it started with. The apply branch only
persists when the key is present, so saving unrelated animation settings does not
shadow the loop's default (#1316 shape). Clarify both repair-timeout errors to name
the stage, the effective seconds, and that this is a local deadline rather than a
provider connection failure.

Backend only; the Settings-form field is left to a follow-up and failure-stage
diagnostics/artifact retention to #2768.

* fix(config): keep repair timeout default out of settings saves

The Settings page PUTs the full GET DTO, so exposing the runtime default caused unrelated saves to persist repair_timeout=180. Omit it until explicitly configured, cover the full round trip, and soften the timeout diagnostic.

---------

Co-authored-by: ZQR1101 <278034003+ZQR1101@users.noreply.github.com>
2026-11-27 14:46:23 +08:00
Bingxi Zhao (Frank)
e96cba219c feat(docling): expose optional enrichments and version remote cache
Fixes #2518
2026-11-15 01:20:52 +08:00
Bingxi Zhao (Frank)
47ae8a27e4 Merge PR #2515: feat(i18n): add Hungarian as an interface and reply language
Combine Hungarian with Italian UI and Hindi reply-language registries; translate 49 newly integrated keys and add the Hungarian endonym to Italian. Regenerate router and frontend contracts. 33 Python locale tests, full Node suite and locale parity pass.
2026-11-14 23:36:26 +08:00
Bingxi Zhao (Frank)
95aa81d624 Merge PR #2544: feat(i18n): add Italian (it) localization
Make Italian quality tests compatible with CommonJS Node test compiler; accept Italiano as reply-language alias; translate 48 keys added by other integrated PRs; regenerate router index and format i18n. 26 Python locale tests and full Node suite pass.
2026-11-14 23:34:48 +08:00
Bingxi Zhao (Frank)
2d493edb84 Merge PR #2521: feat(i18n): add Hindi as a reply language
Regenerate the lazy route index after the reply-language contract changes; targeted tests passed.
2026-11-14 23:16:33 +08:00
Bingxi Zhao (Frank)
9e7f44f978 Merge PR #2616: feat(search): add SearchApi provider with web, news and scholar modes
Remove the obsolete Google News link=resolved parameter; preserve returned redirect URLs and verify them with a realistic response fixture.
2026-11-14 23:06:04 +08:00
Bingxi Zhao (Frank)
7af36949bb Merge PR #2654: feat(search): make the Zhipu request engine configurable (#2617)
Keep all four supported Zhipu engines, including saved Sogou and Quark profiles; verify config aliases and request overrides and format tests.
2026-11-14 23:05:33 +08:00
Bingxi Zhao (Frank)
4c67b87018 Merge PR #2529: feat: add SpecStream as a web search provider
Register both independently added search providers and preserve both provider test cases and display labels.
2026-11-14 23:00:45 +08:00
Bingxi Zhao (Frank)
006b369008 Merge PR #2533: feat(search): add DeepSeek standalone SERP provider 2026-11-14 23:00:23 +08:00
Bingxi Zhao (Frank)
3fc9d2ce18 Merge PR #2534: feat(web_fetch): pluggable fetch backend with DeepSeek Fetch as first alternative
Combine independent locale additions and regenerate integrated route index.
2026-11-14 23:00:23 +08:00
Bingxi Zhao (Frank)
fa190d2f3d Merge PR #2531: fix(config): let an explicit profile api_format survive the linked connection (#2451) 2026-11-14 22:49:38 +08:00
wmym
108cddf26d feat(search): make the Zhipu request engine configurable (#2617)
The Zhipu web-search provider hardcoded search_std, leaving search_pro
( higher recall, 3x price ) unreachable from any configuration surface.

- providers/zhipu.py resolves the engine from the call-time value, then
  the provider config's search_engine/engine field, then search_std;
  only search_std/search_pro are allowed and unknown values warn and
  fall back to the default instead of raising.
- The engine rides the resolved search config the same way max_results
  and proxy do: active search profile field first, then
  tools.web_search.search_engine in main.yaml, then None (provider
  default), injected into the provider kwargs by web_search().
- get_current_config() surfaces the resolved engine.

Tests cover the default payload, config-driven search_pro, the engine
alias, invalid values warning and falling back, and the end-to-end
settings -> resolved config -> real ZhipuProvider -> payload flow.
2026-11-13 01:24:43 +08:00
Gabs Ferreira
c027138329 feat(search): add SearchApi provider with web, news and scholar modes
Add SearchApi (searchapi.io) as a web-search provider, following the Serply
shape: one key, three modes (search -> google, news -> google_news,
scholar -> google_scholar) behind a single GET endpoint selected by the
`engine` parameter. Rows are plain SERP results, so consolidation still
writes the answer and Scholar rows render through the shared academic
template via the `searchapi_scholar` -> `serper_scholar` mapping.

- Key travels only as `Authorization: Bearer`, never in the URL; requests
  carry `Accept: application/json` and `User-Agent: DeepTutor`.
- Google retired `num` for web and news results, so those are cut
  client-side with `max_results`; Scholar still honors `num` (capped at 20).
- News sends `link=resolved` so links point at the publisher instead of a
  Google redirect, and prefers `iso_date` over the relative `date`.
- Scholar maps `publication`, `inline_links.cited_by.total`, `resource.link`
  and `data_cid` onto the Serper attribute keys; a dead `javascript:` PDF
  badge is dropped.
- Non-200 raises with the API's `error` message; a non-JSON body raises too.
- Spec table entry (`requires_api_key=True, soft_fallback=False`), registry
  import, consolidation mapping and `deeptutor init` wizard entry reading
  `SEARCHAPI_API_KEY` / `SEARCH_API_KEY`.
- Nine tests mirroring the Serply block, with fixtures shaped after live
  responses from each engine.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-11-10 15:58:19 -03:00
Daniele Lucarelli
377bf10fa9 feat(i18n): add Italian (it) localization 2026-11-09 08:48:31 +00:00
evan188199-tech
91104d9a3f fix(web_fetch): settings UI for backend + harden DeepSeek fetch cap (#2448)
Addresses Air R1/R2 review blockers on top of the opened PR head:
Settings GET/PUT /api/settings/web-fetch with UI control; DeepSeek fetch
uses identity encoding, raw bytes, and capacity checks before buffer extend;
provider-branding treats `local` as generic.
Air Codex R3 on MacBook Air: READY.
2026-11-09 16:23:50 +08:00
evan188199-tech
1a9c006a2d feat(web_fetch): pluggable fetch backend with DeepSeek Fetch as first alternative (#2448)
Add a FETCH_PROVIDERS spec table next to SEARCH_PROVIDERS and a
deeptutor/services/fetch/providers registry, mirroring the search-provider
shape: local (the unchanged in-process extractor, default) and deepseek
(POST /v1/tools/fetch, Bearer auth; key from kwargs > env > DeepSeek chat
profile).

fetch_url_as_markdown gains backend=None -> DEEPTUTOR_FETCH_BACKEND ->
local. The scheme/SSRF gate runs before any remote backend so a private
URL is never handed to a third party. Retryable backend failures
(401/402/403/408/429/5xx, network, missing key) fall back to the local
extractor; 400/404/413 and an empty body are hard failures. Remote
outcomes keep the requested URL for citations; the crawler/KB site sync
stay local. All tests mock HTTP offline.
2026-11-09 12:53:31 +08:00
evan188199-tech
0a54ec76af feat(search): add DeepSeek standalone SERP provider (POST /v1/tools/search)
Engine-level search provider backed by DeepSeek's /v1/tools/search endpoint,
distinct from the model-side web_search tool mapping: works with any
configured LLM. Rows carry no model-written answer, so consolidation still
supplies it.

- providers/deepseek.py: Bearer auth, count capped 1-50, need_content
  default False (page Markdown kept in SearchResult.content only when
  requested), summary preferred over snippet as the model-facing blurb,
  authority/rerank_score in attributes, proxy honored, base_url used
  verbatim with the documented endpoint as fallback. No new dependency.
- SEARCH_PROVIDERS: label DeepSeek, requires_api_key=True,
  soft_fallback=False (billed per request; a missing key raises instead
  of landing on DuckDuckGo).
- Init wizard entry with DEEPSEEK_API_KEY/SEARCH_API_KEY env keys, keeping
  the wizard set equal to the backend table.
- TracePresentation PROVIDER_LABELS: deepseek -> DeepSeek (titleCase would
  render "Deepseek").
- Tests: row mapping, 401/402/429 paths, missing key fails before network,
  and the base_url/proxy/max_results contract via _NEW_PROVIDERS.
2026-11-09 11:52:03 +08:00
ZQR1101
070bca431c fix(config): let an explicit profile api_format survive the linked connection (#2451) 2026-11-09 11:09:23 +08:00
evan188199-tech
70f610a63c feat: add SpecStream as a web search provider
GET /v1/web-search with Bearer auth, answer-first: the confirmed answer
maps onto WebSearchResponse.answer (supports_answer), ranked sources onto
citations/search_results, and list rows ride along in metadata. No count
parameter exists on the endpoint, so max_results caps client-side like
Aliyun IQS. Registered in the SEARCH_PROVIDERS spec table as a paid
provider (soft_fallback=False); tests mock requests offline.

Closes #2516
2026-11-09 07:04:12 +08:00
Arrunabh Singh
b0bf8cf2d4 feat(i18n): add Hindi as a reply language
Add Hindi (hi, हिन्दी) to the reply-language contract, following step 4
of docs-for-dev/I18N.md and the earlier Malay change (550268e1):

- SUPPORTED_RESPONSE_LANGUAGES, the settings router's ResponseLanguage,
  the prompt-language label and the settings-spec reply choices;
- "hindi", "हिन्दी" and "हिंदी" aliases in the backend and web
  normalizers (hi-IN and hi_IN resolve through the base code);
- the web ResponseLanguage type, isResponseLanguage() and
  RESPONSE_LANGUAGE_OPTIONS, which the partner picker shares;
- regenerated frontend contracts, and tests mirroring the Malay change.

The interface language is unchanged: no web catalog or picker entry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 18:24:54 +05:30
gezakepek-tech
adc80e5038 feat(i18n): add Hungarian as an interface and reply language
Adds a complete Hungarian (hu) locale alongside the existing catalogs, wired
through every seam a language has to pass so none of them silently serves
English to a Hungarian reader.

Frontend: the hu catalog covers all 6,584 English keys with matching
interpolation placeholders, registered in the locale registry, the lazy bundle
loader, Intl date/number formatting (hu-HU) and the reply-language picker.
`language.hungarian` ("Magyar") is added to every existing catalog so the
endonym is shown whatever the current interface language is.

Backend: "hu" is accepted by the launch, interface and reply-language
normalizers and offered in both settings choice lists, named in the prompt
language labels, and carries the Hungarian copy of the CLI-app, MCP and
sandbox messages, the quiz-judge prompt, the book export labels, the book
overview front page and the voice language list.

Scope: the CLI installer banner (`deeptutor/runtime/banner.py`) keeps its
English text for hu and falls back through `_pick_language`; it is terminal
setup copy unused in server deployments and is left for a follow-up.

Evidence:
- `python -m pytest tests/i18n/test_hungarian_locale.py` — 33 passed
- `npm run test:node` — 1353 passed (adds hungarian-locale-quality.test.ts)
- `npm run typecheck` — clean
- `node scripts/i18n_parity.mjs` — OK
- `node scripts/i18n_audit.mjs` — hu: 4529/4529 used keys (100.0%), strict
- `node scripts/generate-contracts.mjs --check` — no drift
- `ruff format --check` / `ruff check` on the touched Python files — clean

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-11-07 14:20:07 +01:00
Bingxi Zhao (Frank)
ce6a5fbc87 Merge #2353 from stefanielizeth73-art 2026-11-06 02:04:53 +08:00
stefanielizeth73-art
3f943e14c8 feat(agent-loop): configure bounded reasoning-budget recovery 2026-11-03 00:12:00 +08:00
stefanielizeth73-art
879421710d feat(embedding): add NVIDIA NIM retrieval embeddings 2026-11-02 15:23:22 +08:00
Bingxi Zhao (Frank)
8a981afb0f Merge commit '1d21aebfbc47453592fa78fb3b787bc414ebb0b1' into codex/validate-reviewed-integration 2026-10-31 18:52:54 +08:00
Bingxi Zhao (Frank)
def8bdc8c6 Merge commit '1876207b5c248eb4ee4375e34779ed332a11d284' into codex/validate-reviewed-integration 2026-10-31 18:52:30 +08:00
Bingxi Zhao
754347767b Merge pull request #2161 from alphaliujin/fix/mineru-readiness-home
fix(readiness): fail closed when the MinerU model cache root is unreadable
2026-10-31 18:30:24 +08:00
Bingxi Zhao (Frank)
4d7090447e Integrate Turkish across complete locale chain, runtime messages and desktop shell 2026-10-31 18:14:34 +08:00
Bingxi Zhao (Frank)
b611c7a690 Integrate current dev and preserve complete locale coverage 2026-10-31 18:08:16 +08:00
Bingxi Zhao (Frank)
0e84ab77fa Integrate reviewed changes and complete Portuguese translations 2026-10-31 18:04:54 +08:00
Bingxi Zhao (Frank)
c836ca354d Merge reviewed locale chain and preserve Vietnamese shared language selection 2026-10-31 17:32:10 +08:00
Antonio-Faure
28d86973a4 fix(i18n): complete the French catalog and follow it for partner replies
- add the 760 English keys missing from the French catalog and translate 229 values still copied from English\n- make a partner's empty reply language (Auto) follow the account model output language instead of hardcoding English\n- label Auto with the configured language and offer every supported response language in the picker\n- localize the Feishu thinking notice for every supported response language\n- add French catalog, picker and partner runtime regression tests
2026-10-30 18:02:55 +01:00
Rimcat-JA
76dbbc36b6 feat(i18n): add Japanese as an interface language
Add a complete Japanese web catalog (web/locales/ja/app.json, every key
of the English catalog) and register "ja" wherever the other interface
languages are listed: the web language registry and loader, date
formatting, the backend UI-language setting and launch settings, and the
generated API contracts. Each existing catalog gains language.japanese.

Japanese was already a reply language; this makes it an interface
language too, following the Polish integration.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 01:56:58 +09:00
Antonio-Faure
b4cb6615d0 feat(providers): add xAI model coverage and Mistral embeddings/voice
- register xAI as an OpenAI-compatible Grok provider (dynamic /v1/models)\n- add Mistral embeddings (mistral-embed / codestral-embed)\n- add xAI Grok Imagine image and video generation\n- add xAI Grok Voice and Mistral Voxtral TTS/STT adapters\n- expose provider/voice hints and add mocked contract tests
2026-10-30 14:57:35 +01:00
bcfernando
5c99a37096 feat(i18n): add Portuguese (pt) interface localization 2026-10-30 10:17:55 -03:00
d41sys
9ddbb92c36 feat: add Vietnamese localization 2026-10-30 02:28:18 +01:00
alphaliujin
0512aed5a1 fix(readiness): fail closed when MinerU model cache root is unreadable
The container backend runs as the unprivileged deeptutor user while
supervisor leaves HOME pointing at root's home. mineru_models_ready()
probed <HOME>/.cache/modelscope/hub/models outside its try/except, so
the PermissionError propagated into build_settings_readiness(), which
maps any exception to parser_probe_failed and shows no cause in the UI.

- mineru_models_ready(): treat an unreadable/absent cache root as
  "cannot confirm" and return False (models_missing) instead of raising.
- build_settings_readiness(): log the parser probe exception with a
  traceback before recording parser_probe_failed.
- Dockerfile: create /home/deeptutor and set HOME for the backend and
  frontend supervisor programs, so profile data resolves under the
  service user.
- Add a regression test for the unreadable-cache-root case.
2026-10-29 18:09:31 +08:00
Erhan ÜRGÜN
e61181a4fc feat(i18n): add Turkish as an interface and reply language
Registers tr in every list that decides which languages exist: the reply-language whitelist and labels, the interface and launcher normalizers, the Settings choices, the web registry and lazy loader, the date locale, the response-language store and the API contract.
2026-10-29 01:05:32 +03:00
Bingxi Zhao (Frank)
2c47cc22ce fix(integration): authenticate search and regenerate route contracts 2026-10-29 01:19:18 +08:00
Bingxi Zhao (Frank)
5ad749ac9c Merge pull request #2025: You.com search provider 2026-10-29 01:13:31 +08:00
Bingxi Zhao (Frank)
dd31a77f58 Merge pull request #2076 into validated PR integration 2026-10-29 00:56:11 +08:00