4771 Commits

Author SHA1 Message Date
Yuchuan He
38af3bc518 fix(llm): preserve Responses system instructions across summaries (#2711) 2026-12-01 21:36:30 +08:00
Yuchuan He
a35231eb92 fix(llm): retain Azure streamed response replay state (#2712) 2026-12-01 21:36:03 +08:00
Sanae
b14267bacf fix(llm): preserve Responses wire aliases during tool replay (#2734)
Serialize SDK responses using API field aliases and omit unset optional
fields before persisting native replay state. Repair legacy async_ fields
on a copy at replay time without altering stored history or argument JSON.

Cover streaming and non-streaming SDK continuations, alias precedence,
and legacy SQLite replay.

Co-Authored-By: GPT-6.1 Sol High
2026-12-01 21:35:29 +08:00
surkhayka
4d33eade83 fix(notebook): use the selected code block theme 2026-12-01 21:24:56 +08:00
Antonio-Faure
572d80c2e7 fix(mcp): bind OAuth Test to the stored server origin (#2763)
* 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>
2026-12-01 20:30:43 +08:00
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
Antonio-Faure
969238486f fix(web): keep Load keys and allow the consent KB
Restore the original Load entry in the ten locale catalogs and keep Load external image as an additional key. Raise the two chat raw-JS budgets by 2 KB for the consent component; #3142 reclaims more than 250 KB on the same routes.
2026-12-01 12:43:17 +01:00
Antonio-Faure
91e8c9c953 feat(chat): arm the answer card as the reply becomes attachable
The Answer label now carries a tinted icon badge and foreground weight.
The bottom rule sits on both corners, fades in the middle, and moves from
20% to 40% opacity when the Attach button becomes active.
2026-12-01 12:33:27 +01:00
Antonio-Faure
efd3bda9ef feat(chat): close the answer card with a bottom accent rule
The header and the textarea now share a soft accent line at the bottom,
so the card no longer ends in visual emptiness.
2026-12-01 12:27:40 +01:00
Shaikh Fardin
8a8cdf785f fix(llm): force temperature 1.0 for gpt-6 and drop reasoning_effort before tools (#2446)
* fix(llm): force temperature 1.0 for gpt-6 and treat reasoning_effort+tools rejection as tool-schema unsupported

* fix(llm): drop reasoning_effort instead of tools when combined request is rejected

---------

Co-authored-by: Shaikh Fardin <152140625+Fardin7798@users.noreply.github.com>
Co-authored-by: OrdoAbChao7 <2369980241@qq.com>
2026-12-01 19:27:05 +08:00
Benjamin Schwing
1271f6a0cd Merge remote-tracking branch 'origin/dev' into HEAD
# Conflicts:
#	deeptutor/api/router_index.json
2026-12-01 11:25:46 +00:00
Antonio-Faure
84dc25064b feat(chat): move Attach into the answer card header
The action now sits on the same line as the Answer label, removing the
footer row and keeping the card compact. The button stays after the
textarea in DOM order, so keyboard focus remains textarea then Attach.
2026-12-01 12:16:21 +01:00
Antonio-Faure
b71f67b4a4 feat(chat): give the inline answer field a paragraph-sized area
A two-line box signals a short answer, but tutor questions usually ask
for a justification or a calculation. Start at four lines, grow with the
text up to 240px, then scroll inside the field.
2026-12-01 12:08:59 +01:00
Antonio-Faure
a0badadfb2 feat(chat): make the inline answer cards full-width and informative
The card now follows the prose column instead of stopping at 460px.
The collapsed chip keeps the question above the answer, and the composer
and sent-message chips reuse the same two-line shape. The question excerpt
is taken from the prose before the marker and persisted with the answer.

The screenshot fixture now answers 'pH 12.26' so the value cannot be
mistaken for a time.
2026-12-01 11:50:12 +01:00
Qiuner
4e5435f17a Merge commit '318619e7139f42421d2e3f7d08447529f15a993f' into architecture/filter-plugin-workers 2026-12-01 07:32:03 -03:00
Qiuner
5c8adb8c21 Merge commit '318619e7139f42421d2e3f7d08447529f15a993f' into architecture/windows-desktop-shutdown 2026-12-01 07:32:00 -03:00
Antonio-Faure
19329948ec i18n(web): translate the external image consent label
Add Load external image to de, uk, vi, tr, hu, it, ja, pl, pt and ko so the new consent label does not fall back to English in strict locale catalogs.
2026-12-01 11:19:01 +01:00
Marcello Pichini
318619e713 fix(mastery): keep apostrophes in study ask-hints (#2851)
The sanitizer deleted every quote character to unwrap a quoted reply,
so "What's ...?" was shown as "Whats ...?". Only unwrap a matching
outer pair, as the chat and reading hints already do.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 17:51:54 +08:00
Mohammad Hijjawi
f07e262ebe fix: ignore code fences inside <think> reasoning when parsing JSON (#2717)
* fix: ignore code fences inside <think> reasoning when parsing JSON

A fence drafted inside a <think> block was picked as the payload before
the reasoning was stripped, so the real JSON after the block was lost.

* fix: decode fence-in-string JSON from the chosen block's offset

The fence-in-string fallback searched the response for the truncated
block text, which can also appear inside a <think> draft, so the draft
was decoded instead of the payload. Keep the chosen fence match's start
offset and decode from there, allowing raw newlines in string values.
2026-12-01 17:50:42 +08:00
Leveling
efea7b5c8d fix(desktop): explain why Apple notarization produced no result (#2723)
notarize.mjs kept only stdout from notarytool submit and reduced every
outcome to one 'no notarization result' error, so the v1.7.3 macOS jobs
failed with an empty {} artifact and nothing in the log (#2714).

notarytool reports most submission failures on stderr, which the script
discarded. Classify the four cases instead - the process never started,
it exited with no output, it printed no result, or it printed something
that is not JSON - and carry the reason into both the thrown message and
a notarization-submission.error.json artifact that records the exit code,
the spawn error and bounded stdout/stderr tails.

The account and password are redacted from everything written out, and
notarization-submission.json keeps its previous shape (raw stdout or {}),
so the upload step and any existing consumer are unaffected.
2026-12-01 17:41:37 +08:00
Antonio-Faure
5c8a26803a feat(web): gate external markdown images behind a click
Third-party markdown images now render a reserved 16:9 consent placeholder and only create an <img> after the reader clicks. The loaded image uses referrerPolicy=no-referrer; local, relative, data and workspace images continue to load inline.

Add a dedicated Load external image translation in en/zh/fr and cover both the simple and rich markdown paths with a Playwright audit.
2026-12-01 10:34:18 +01:00
bluefateludi
c20e42fd99 fix(llm): record nested prompt cache write counts (#3108) 2026-12-01 17:26:47 +08:00
Antonio-Faure
75636f0735 perf(web): improve knowledge-base and settings accessibility and payload (#3139)
* fix(web): refine knowledge and settings accessibility and layout

Name row controls from their visible titles, portal tooltip descriptions out of tablists, and make the knowledge tabs keyboard-complete. Also stack the KB master-detail on phones, add a section-scroll hint, demote the indexing diagnostic to its detail tab, and consolidate the knowledge type scale.

* perf(web): cut knowledge and settings payload

Serve raster engine marks through next/image, stop preloading the serif face on pages that do not use it, and prefetch settings routes only on hover or keyboard focus instead of on first paint.

* docs(perf): record knowledge and settings audit

Document the protocol, baseline and after medians, payload and accessibility results, limits, and reproduction commands, with mobile before/after screenshots.

* test(web): match the model row's visible accessible name

The row no longer overrides its name with a provider-first aria-label; select it by the model-first text a screen reader now reads, which also contains the visible default/task badge.

* fix(web): keep the MinerU download-type name in the locale catalog

Reuse the existing Download models and Type strings instead of introducing a new t() literal, so the strict i18n audit stays green.

* docs(perf): link the UI audit from the handbook index

The docs contract requires every guide under docs-for-dev to be reachable from README.md.

* docs(perf): record the isolated knowledge-detail LCP

Re-measured the detail route with the host pinned away from unrelated work; the 668 ms row was contention, while the isolated median is 568 ms and the stable repeats overlap the baseline.

---------

Co-authored-by: Antonio-Faure <209759495+Antonio-Faure@users.noreply.github.com>
2026-12-01 17:12:12 +08:00
Carl
242b24beeb fix: keep chats usable after oversized tool calls (#3144)
Closes #2909.

Omit the fewest eligible historical tool-argument payloads so oversized completed exchanges remain replayable, without touching signed/native provider rounds or durable history.
2026-12-01 17:03:29 +08:00
Leoy
8b2448e293 fix(knowledge): fit uploaded names and folder segments into the 255-byte limit (#3140)
Byte-fit KB upload filenames and folder segments to NAME_MAX, and share fit_filename_bytes with attachment/reading stores.
2026-12-01 17:00:42 +08:00
WolveBrown
a3ed306cec perf(turns): prepare account directories once per recovery visit 2026-12-01 16:58:36 +08:00
AleFlyX
508a2bda35 test(parsing): 给清理用例补墙钟断言,并给夹具加真实耗时兜底
变更:
- 清理用例在夹具首次发布 `child.pid` 时记下墙钟时间,断言此后父进程在
  `POST_MARKER_BUDGET_SECONDS` 内返回,不再只靠整轮 20 秒的宽上限。
- 夹具的虚拟时间上限之外补一条真实墙钟兜底。虚拟时钟只在
  `local.time.sleep` 里推进,生产改成不调用它时虚拟时限永不触发,
  没有兜底就会无限空转。

验证(本机 Linux / CPython 3.13.5):
- 原 #3089 回归(时限 +8 秒):清理用例失败
- 时限判定处 8 秒真实停顿:清理用例失败
- 健康运行下 `after_marker` 约 1.2 秒,整轮约 3 秒
- 中途停顿 7.0 秒仍通过、7.8 秒失败;生产清理各环节各加 4 秒(均在
  其自身 5 秒预算内)时失败
- 轮询间隔 0.002 / 0.05 / 0.07 / 0.3:均 19 passed, 1 skipped
- pytest tests/services/parsing/:220 passed, 2 skipped
- pytest tests/runtime/test_launcher.py:67 passed, 1 skipped
- ruff check / ruff format --check tests/services/parsing/:PASS

已知局限:这条墙钟断言从「循环第一次调用 check()」起算,从进程启动到
首次 check 之间的耗时不在窗口内;兜底也只在 poll() 里检查,两次轮询
之间的阻塞观察不到。彻底解决需要外部超时机制,见 #3126 的讨论。
2026-12-01 16:57:07 +08:00
Axton Ji
04eb2ac82e fix: batch indexing journal writes for per-document status updates (#3137)
IndexingRun.document() re-reads the journal and atomically rewrites the
whole .indexing-run.json on every call. The LlamaIndex loader marks each
accepted source "embedding" in a synchronous loop on the event loop, and
publication marks every loaded Document (one per page) "completed" the
same way, so recording n statuses costs O(n^2) bytes of I/O with no
await in between. On a 4,320-document reindex this held the loop for
over 100 s, /health/ready stopped answering, and the desktop supervisor
killed the core.

Add IndexingRun.documents(sources, status, **details), which applies one
status to many sources under a single ownership check and a single
journal write, and use it from the loader, the LlamaIndex publication
step and the RAG service's indexed-file callback. document() now
delegates to it, so single updates behave as before.

Fixes #3046

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 16:56:02 +08:00
Leveling
d889815577 fix(mastery): resolve formatted choice answers by exact option body (#3129)
Fixes #2863.

Exact normalized option-body matching for resolve_answer (whitespace / Markdown / LaTeX wrappers), without normalized substring false positives. Preserves literal operators and unresolved ambiguity.

Co-authored-by: Chih-Kai-Wang <290806361+Chih-Kai-Wang@users.noreply.github.com>
2026-12-01 16:51:36 +08:00
iron ox
8fe2567c65 fix(knowledge): report live progress for LlamaIndex folder batches (#2483)
Forward embedding-batch progress through DocumentAdder so LlamaIndex folder
syncs and multi-file uploads no longer stay at 0% until the whole batch returns.

Co-authored-by: zhouyao01 <zhouyao01@mucang.cn>
2026-12-01 15:01:46 +08:00
Mohammad Hijjawi
7bd5b99f9a fix(book): match language cues as whole words (#2477)
Automatic book language detection matched its English-word cues as bare
substrings, so a topic that only mentioned a place or a subject forced
the book into another language: "energy policy in Germany" and "Berlin
German dialects" became German, "the main English clubs" became English
over the interface language, and any mention of "Traditional Chinese
Medicine" became Traditional Chinese.

Bound the Latin and Cyrillic cues with word boundaries and require the
phrased "in Traditional Chinese" form, matching how every other English
cue is written. CJK cues are unchanged.
2026-12-01 14:57:45 +08:00
iron ox
97e9ef8d44 fix(llm): omit optional replay status for custom Responses gateways (#2487)
Omit optional status on message/reasoning/function_call items when building
Responses requests for the custom binding, so gateways that reject
unknown_parameter inside an HTTP 200 stream no longer fail durable turns.
Keep the bounded HTTP-error retry for other cases.

Co-authored-by: zhouyao01 <zhouyao01@mucang.cn>
2026-12-01 14:55:05 +08:00
LIziak112
9ea0e96040 fix(desktop): preserve Windows content zoom across restarts (#2970)
* fix(desktop): preserve Windows content zoom across restarts

* fix(desktop): apply rendered Windows content zoom

Use isolated webContents zoom so saved factors scale the rendered page without affecting the shell. Add native Windows Electron coverage for viewport and DPR changes, reloads, and cold-start restoration.
2026-12-01 14:37:47 +08:00
Alex Castillo González
12e3a8ae0d fix(llm): accept list-of-blocks content from OpenAI-compatible providers (#2795)
Mistral reasoning models return `content` as a list of typed blocks
(thinking + text). `_parse_chunks` joined those lists directly and raised
TypeError, and `_parse` / the streaming content callback passed the raw
list through. Normalise with the existing `_extract_text_content` helper.

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-12-01 14:17:51 +08:00
crimson-gzx
f56225f9b1 fix(llm): send session-scoped prompt_cache_key on Responses API requests (#2827)
Co-authored-by: Josh Guo <crimsongzx@gmail.com>
2026-12-01 14:13:16 +08:00
Andrew Chen
da9f65b6b3 fix(voice): speak \top and \intercal superscripts as transpose (#2828) 2026-12-01 14:08:38 +08:00
lipeh1
c1a2967045 feat(web): filter learning records by type (#2754)
Co-authored-by: lipeih <lipeihan@eazytec.com>
2026-12-01 14:02:04 +08:00
kevin
e8b22fe00e fix(documents): drop XLSX phonetic runs from fallback cell text (#2260) 2026-12-01 13:55:31 +08:00
Yuchuan He
25cc33e475 fix: serialize notebook manager initialization (#2744) 2026-12-01 13:55:22 +08:00
Tazeem
72ae8d4703 fix(config): use selected provider protocol after moving a model (#2759) 2026-12-01 13:55:14 +08:00
Mohammad Hijjawi
be86dc1a9e fix(question): hold the quiz plan to the requested per-type counts (#3057)
The quiz panel sends per_type_counts (e.g. choice=3, fill_in_blank=2)
and the planner prompt asks for that exact mix, but _parse_plan only
enforced the allowed types and difficulty. A planner that returned five
choice templates produced a five-choice quiz.

Retype the surplus templates to the types that are still short, keeping
topics, order and difficulty.
2026-12-01 13:55:05 +08:00
Yuchuan He
73bfa3f9e0 fix(turns): prevent duplicate replies when Stop races persistence (#3074) 2026-12-01 13:54:56 +08:00
wojiecihuo
5eae58dbc9 Merge pull request #3081 from zszz3/refactor/prompt-slimming
refactor: state each prompt rule once across playbooks, tool schemas and language packs
2026-12-01 13:13:28 +08:00
游标卡尺
8b18b7a020 feat(providers): add LiteLLM as a local OpenAI-compatible provider (#2832)
* feat(providers): add LiteLLM as a local OpenAI-compatible provider

* test(web): keep LiteLLM on the generic provider-branding fallback

---------

Co-authored-by: ZQR1101 <278034003+ZQR1101@users.noreply.github.com>
2026-12-01 13:00:40 +08:00
qodelicious
311629415d feat(cli): add --offset and --format json to session list (#2836)
* feat: add session list pagination and JSON output

* test(cli): strip ANSI escapes when checking session list --help output
2026-12-01 12:57:13 +08:00
JamesWuHK
b0e9712d93 fix: render native GeoGebra formulas and canonical styles 2026-12-01 12:16:39 +08:00
JamesWuHK
44962397f3 fix: finish Visualize after successful submission 2026-12-01 12:16:39 +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
iQuantum
b5fb281a3e fix: default Anthropic to a Claude model Anthropic still serves (#2888)
AnthropicProvider and the agentic client's Anthropic adapter fell back to claude-sonnet-4-20250514, which Anthropic retired on 2026-06-15, so an Anthropic binding with no model failed with not_found_error. Both now use one DEFAULT_ANTHROPIC_MODEL constant, claude-sonnet-5-5.
2026-12-01 11:20:50 +08:00
zszz3
3bbc0aafc9 test(prompt): scope the single-source scan for the maths rule
The maths single-source scan reads only prompt packs, capability modules,
capability Markdown prompts (such as notes/prompts/*/system.md) and the
fragment files instead of every file in the package. The zh/en playbook
comparison already checks line by line in
tests/capabilities/test_mastery_prompt_slimming.py.

Refs #2975
2026-12-01 11:17:29 +08:00