* fix(mcp): bind OAuth Test to the stored server origin
A saved OAuth grant is addressed by the path name, but Test accepts an
unsaved payload URL. Without an origin check a valid stored bearer is
attached to any origin the caller names, so a draft can exfiltrate the
grant. Load the owner-scoped stored server and require the draft URL to
match its normalized origin; otherwise return needs-authorization
without opening a transport or touching the grant.
Refs #2589.
* chore(api): regenerate the router index fingerprint
* chore(api): regenerate router_index.json against dev
---------
Co-authored-by: Antonio-Faure <209759495+Antonio-Faure@users.noreply.github.com>
Co-authored-by: OrdoAbChao7 <2369980241@qq.com>
* 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>
* 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>
* fix(pptx): resolve font fallback in PDF previews and exports
* test: match host path semantics in the PPTX preview fixture
---------
Co-authored-by: Qiuner <wdst3635@163.com>
* Fix quiz-attempt 500 when the Book entity has no chat_session_id
book.py's attempt sync read book.chat_session_id, an attribute that only
exists on CreateBookRequest/BookInputs (a legacy creation-time shorthand)
and is not persisted on the Book model — so every quiz attempt without a
page-bound chat session raised AttributeError after the progress was
saved, returning 500 and dropping the Focus-Check assessment sync.
Read only the persisted per-page mapping, and cover it with a regression
test whose fake mirrors the real entity (no chat_session_id attribute).
* style: apply ruff format
* chore(api): refresh router index for the book router
---------
Co-authored-by: zszz3 <91608029+zszz3@users.noreply.github.com>
Continues #2978 and closes#2887. Includes the original Windows file actions, integrates the changes with dev, and adds an explicit default-app action.
Co-authored-by: Botong Wu <2048400180@qq.com>
* 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>
Prepare v1.7.3 notes for reading and book editing, expanded provider and
agent connections, learning records, model streams, and desktop upgrades.
Sync README prose and 11 translations, archive older release notes, and
update the package version. Resolve release lint/type blockers with explicit
parser and capability contracts, compatible Book call forwarding, accurate
auth task types, and quoted SQLite schema identifiers. Cover positional Book
calls and quoted legacy columns; align KB seed tests with visible retrieval
failure reporting. Keep HTTP fixtures independent of host proxies and translate
new Portuguese UI copy.
Release notes: assets/releases/ver1-7-3.md
Retain admission error text and localized model-access guidance; allow explicit retry to revalidate access instead of permanently blocking stored messages. No automatic retry on reload. Backend tests and both manual retry paths passed.
Validate chapter existence, spine presence, and protected overview deletion before claiming a revision; cover failed edits followed by valid retries (22 passed).
All attached units together stay within one unit's cap (60k chars). The unit
that crosses it is cut with a named marker; later units are listed by name.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add / rename / reorder / delete chapters after generation through REST
endpoints mirroring the block-CRUD handlers. New chapters are pending
shells; already-compiled pages are never recompiled or discarded. Each
edit carries the chapter's order/title onto its pages so the reader-visible
sequence follows, and delete prunes only its own pages plus the concept
graph, prerequisites, and progress refs.
Part of #2571
Chat turns reach attached reading units through the source inventory and
read_source. Deep Solve, Visualize, Math Animator and the other non-chat
capabilities get attachments inlined into the user message instead, but
reading references were left out there, so a turn with reading sections
attached ran without them. They now go in as [Reading Sections], next to
[Attached Documents] and [Book Context].
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
POST /api/space/mcp/servers/{name}/test discarded the path name, so a
probe of an OAuth-backed server built its token store with '' and every
Test answered "ValueError: Unsafe MCP server name for an OAuth store: ''"
— including for a server that was authorized and connected.
probe_server now takes a server_name (the name the saved connection
would address the grant under) and the space router passes the path
name for OAuth configs. A scratch name no grant could live under (an
unnamed draft) is answered the way an unauthorized server is instead of
the store's refusal; non-OAuth probes stay nameless as before.
Fixes#2587
Signed-off-by: evan188199-tech <238371241+evan188199-tech@users.noreply.github.com>
A rejected POST /api/books/{id}/refresh-fingerprints (force=false, stale
pages not yet recompiled) bumped and persisted book.revision before the
engine refused it, so the client's expected_revision went stale and the
force=true retry always lost the revision race (409 forever).
Run the engine's refusal check (new read-only preflight
check_refresh_kb_fingerprints -> ensure_can_refresh_fingerprints) before
_claim_content_mutation; a rejected dismissal is now side-effect free and
the force retry with the same expected_revision succeeds. Regenerate the
router index fingerprint.
Carry the #958 service-layer reasoning_effort override through the whole
turn contract: the core TurnRequest LLMSelection accepts the field
(validated against VALID_REASONING_EFFORTS, old two-ID payloads unchanged),
the generated web contracts are regenerated, and ChatStateAdapter's
asLLMSelection restores a legal override instead of dropping it.
The composer gains a selector beside the model picker, offering only the
levels the selected model supports (live supported_reasoning_efforts or
the provider/model tables) narrowed to the wire vocabulary, hidden when
the model has none. The choice persists on the conversation's
llm_selection, so the next send uses it without a backend restart and
other conversations are unaffected; switching models resets the override.
Precedence stays conversation override -> profile/model default ->
provider default, and the context-budget readout reports the effective
effort beside the model when one was used.
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.
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>
The quiz judge stripped the data: prefix from a submitted answer image and
re-guessed the MIME from the filename, so a JPEG photo sent as
data:image/jpeg with the default answer.png filename was relabelled
image/png and rejected by strict vision providers. Parse the media type
from the data URL and prefer it over the filename guess (an explicit
mime_type field still wins); same fix for the legacy single-image branch.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>