127 Commits

Author SHA1 Message Date
Bingxi Zhao (Frank)
addb783d2f Merge preview and CI fixes into video lesson branch 2026-10-27 01:40:39 +08:00
Bingxi Zhao (Frank)
6bbcc00c55 Merge dev into preview, preserving preview features
Integrate dev fixes with preview's Python/TypeScript schedulers, chat queue, learning navigation, and live turn persistence.
2026-10-27 01:16:58 +08:00
Bingxi Zhao (Frank)
28c11e2ae8 feat: update notes, chat interactions and workspace UI on preview
Remove course pages, APIs and the course_study capability. Add anchored note
threads and reviewed learning-block generation, queued and withdrawable chat
messages, quote attachments, side chats, and the calendar/favorites/navigation
updates.

Keep preview's existing backend architecture. Wire the new features through
its Python application and existing chat engine, retain legacy selected-text
requests, persist mid-turn messages in replay, and restore note context when
regenerating. Leave stored user data intact.

Validate frontend contracts, dependency boundaries, types, 1290 node tests,
840 rendered tests, lint, localization and the production build. Exercise
session/notes/API regressions, 53 chat-engine tests and 20 Python/native
integration tests with isolated runtime data.
2026-10-26 22:13:34 +08:00
SeleiXi
6b7897a32f feat(video_lesson): register the video lesson capability
`video_lesson` (CLI alias `lesson`) turns a question into a playable
Remotion explainer:

1. code_generation: the lesson writer drafts Lesson.tsx
2. render_check: compile and frame-check it, feeding failures back,
   up to three attempts
3. render_output: write the player page and emit it as an html artifact,
   along with the lesson's summary and source

npm packages are installed on first use while the first LLM call is
still running. The capability reports itself unavailable when node or
npm is missing. Its LLM budget lives under plugins.video_lesson in
agents.yaml (48k tokens by default: a whole lesson comes back in one
reply).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 23:58:03 +08:00
Bingxi Zhao (Frank)
9aae961412 Merge PR #1957: separate private source evidence from explicit public presentation 2026-10-19 00:53:44 +08:00
Bingxi Zhao
63621137a4 Merge pull request #1911 from Owaid0723666/feat/add-onomeo-provider
feat(providers): add onomeo as an OpenAI-compatible gateway
2026-10-15 03:23:16 +08:00
yepyhun
755686264d fix(mastery): separate source inspection from assessment delivery 2026-10-13 13:49:35 +02:00
yepyhun
136c41fb71 test(agentic): reproduce schema-valid null rejection 2026-10-13 00:34:53 +02:00
Owaid0723666
bfdfb18e48 feat(providers): add onomeo as an OpenAI-compatible gateway
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 15:54:36 +09:00
Bingxi Zhao (Frank)
6cf793bd86 release: v1.6.14
Ship original-source visual practice, recoverable indexing, unified video
Reading, scientific research tools, managed plugins, and a learning journal
as summarized in assets/releases/ver1-6-14.md.

Improve provider setup and protocol-aware endpoints. Restore missing
localized setup and Ukrainian UI text, keep plugin loading in the plugin
layer, harden research XML parsing, and repair isolated test fixtures and
type-checking errors found by the release gate.

Sync README prose and all eleven translations, bump the package version,
and update the stable release announcement.

Validation: 10180 Python tests and 8 subtests passed (28 skipped); 1303
Node tests passed on Node 22; 24 provider UI tests passed. All pre-commit
hooks, ruff, translation checks, documentation checks, and docs build passed.
2026-10-08 11:34:42 +08:00
Bingxi Zhao (Frank)
8986c31580 feat(reading): complete Watching convergence with safe legacy migration (#1378)
Adapted the migration foundation from PR #1384 while preserving current workspace, caption and turn-admission safeguards.

Co-authored-by: XZH <cto@xzh.ai>
2026-10-08 02:48:50 +08:00
Bingxi Zhao (Frank)
081c9e6d98 fix(chat): bound cold-start stream waits and avoid nested retries (#1421) 2026-10-08 00:00:30 +08:00
Wu Shuwen
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>
2026-10-07 20:51:37 +08:00
Felix
4b6cddbe49 feat: add Opper as an LLM and embedding provider (#1786)
Opper (https://opper.ai) is an EU-hosted AI gateway: 700+ models from
50+ providers behind one OpenAI-compatible API and one key. This adds it
as a named provider. The LLM entry follows the Requesty one (#1631). The
embedding entry follows the OpenRouter one, with a default model and
dimension like the OpenAI entry.

- provider_registry.py: gateway ProviderSpec after FutureInfra. Env
  OPPER_API_KEY, base URL https://api.opper.ai/v3/compat. Base URL
  detection keys on the api.opper.ai host rather than a bare "opper"
  substring, so unrelated URLs that happen to contain it are not claimed.
- Embeddings: Opper serves OpenAI-compatible /embeddings under the same
  base URL. Registered in embedding_endpoint.py (label, default endpoint,
  /embeddings path rule), provider_runtime.py (default
  text-embedding-3-large, 3072 dims) and the GraphRAG OpenAI-compatible
  binding set.
- Tests: registry lookup and base detection, runtime resolution for the
  opper binding and for an openai binding pointed at Opper, the Settings
  LLM choice, native tool calling, the embedding runtime and the GraphRAG
  api_base translation.

Like the other recent gateway additions, it stays out of the curated
init menus, the README and the capability table. Opper model ids are
bare names (claude-sonnet-4-6, gpt-5.4-mini, text-embedding-3-large), so
the existing model-level rules for claude-, gpt-5 and gemini apply as
they are, and the text-embedding-3 rule sends dimensions=3072.

Checked: python -m py_compile on the ten changed files, git diff --check.
Not run locally: pytest, ruff and pre-commit.

Disclosure: I work at Opper.

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-authored-by: Bingxi Zhao (Frank) <13051345080@163.com>
2026-10-07 20:50:37 +08:00
yeheboo
6431539efe feat(providers): add Y-API as an OpenAI-compatible gateway (#1791)
Adds a ProviderSpec for Y-API plus the same three assertions the other
gateway rows carry. Declares the Anthropic Messages endpoint through
api_base_by_format, so profiles on this provider can pick that wire.
2026-10-07 20:48:16 +08:00
Bingxi Zhao (Frank)
be4c144171 Merge dev while preserving futureinfra and existing provider contracts 2026-10-04 13:58:31 +08:00
Bingxi Zhao (Frank)
6a236e7b62 Merge dev to retain Requesty and API Route provider registrations 2026-10-04 13:54:09 +08:00
uxidev
cce8292ecc feat: add FutureInfra as an LLM provider
Register FutureInfra as an OpenAI-compatible gateway provider (env FUTUREINFRA_API_KEY, base URL https://futureinfra.ai/v1/ai, alias future_infra) with tests mirroring the Cheaper Inference provider.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-02 00:25:03 +09:00
dennyho0917
8972c8786a feat: add API Route LLM gateway provider 2026-09-30 14:01:30 +08:00
Thibault Jaigu
21de8bf0c8 test: cover Requesty provider registry and runtime resolution 2026-09-28 20:20:13 +01:00
aiapienthusiast
cbb0cc4054 Add 'cheaperinference' to client provider list 2026-09-23 19:15:43 +04:00
Bingxi Zhao (Frank)
ffbe0a541b fix(agentic): replay reasoning in repair and report retries 2026-09-23 12:30:01 +08:00
Bingxi Zhao (Frank)
83ffee9e54 Merge remote-tracking branch 'origin/dev' into codex/pr-synthesis-20260923 2026-09-23 12:18:50 +08:00
Bingxi Zhao (Frank)
69790aaeac test(visualize): pin runtime parameters independently of local config 2026-09-23 12:12:32 +08:00
Bingxi Zhao (Frank)
55490af65e Merge issue fixes into PR synthesis
Combine knowledge bootstrap coverage and preserve later progress-isolation tests, native notebook tooltip, and locale-aware tool-hint fallback. Regenerate frontend contracts and align test fixtures with merged APIs.
2026-09-23 12:06:19 +08:00
Bingxi Zhao (Frank)
69058b48bb fix(rag): avoid false IMA citations on empty and failed search (#1500) 2026-09-23 11:00:37 +08:00
Bingxi Zhao (Frank)
cd24fd3a44 Merge commit 'refs/pr/1387' into codex/evan-backend-prs-20260923 2026-09-23 10:28:52 +08:00
Bingxi Zhao
5c1495b3f6 Merge pull request #1513 from evan188199-tech/codex/fix/rag-empty-result
fix(rag): report empty retrieval results (#1500)
2026-09-23 10:24:47 +08:00
Bingxi Zhao
d43e24a048 Merge pull request #1499 from AoHanBei/fix/llm-key-rotation-exhaust-pool
fix(llm): try every API key after rate limits
2026-09-23 10:24:42 +08:00
Bingxi Zhao
d048b835e8 Merge pull request #1529 from unifically-dev/feat/unifically-provider
Add Unifically LLM provider
2026-09-23 10:22:49 +08:00
Frank_zhu
6fbed6c28e fix(research): recover report labels on finished reply (#1514)
Keep the streaming 64-char probe strict, then re-read a finished report
reply so an unclosed/over-wide fence or a matching ## n. heading no
longer kills the turn. Raise report_section max_tokens to 12000 and
turn reasoning off for report prose so first attempts stop starving.
2026-09-21 10:27:09 +08:00
Bingxi Zhao (Frank)
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.
2026-09-21 02:30:40 +08:00
UnificAlly
d987908b85 Add Unifically LLM provider 2026-09-20 16:02:34 +04:00
XZH
7dde859eaf fix(rag): report empty retrieval results (#1500) 2026-09-18 16:35:55 -07:00
AoHanBei
e8842ff114 fix(llm): try every API key after rate limits 2026-09-16 22:15:06 +08:00
XZH
5a73ce8fe0 feat(audio-overview): add KB audio overview pipeline 2026-09-10 18:55:58 -07:00
Bingxi Zhao (Frank)
4e2f088548 merge: bring 19 reviewed PRs from origin/dev into dev
Resolves two collisions with the fixes committed locally tonight:

* book/blocks/_llm_writer.py — #1366 threaded a reasoning_effort
  through llm_json while 5ac8e2c9 replaced this file's private
  _json_has_expected with the shared json_payload_is_usable.
  Taking either side alone breaks: origin/dev's calls a helper that no
  longer exists, ours drops the caller's explicit effort. Kept the shared
  helper and the threading, and the retry now reuses an explicitly given
  effort so a round deliberately run without thinking cannot re-enable it.

* runtime/agentic/tool_dispatch.py — #1357 added tool_timeout /
  tool_max_retries to execute_tool_call in the same parameter list where
  4e816d79 renamed unknown_error_message_factory (tool) to
  tool_error_message_factory (tool, error). Both are needed: the
  dispatcher already passes the timeout pair through, and every call site
  in the tree now uses the renamed factory.
2026-09-10 23:52:04 +08:00
evan188199-tech
30e0f7c3a2 fix(research): enforce tool timeout and retry policy (#1357)
Co-authored-by: XZH <cto@xzh.ai>
2026-09-10 23:45:30 +08:00
Bingxi Zhao (Frank)
0027051b32 fix(question): tell a starved plan apart from an empty one, and retry it
Ask for a quiz with a reasoning model and sometimes one question arrives,
sometimes none, with nothing in the UI and one `LLM returned empty
response` in the log (#1318). Reproduced on both a 35B llama.cpp build
and a 27B vLLM one, so it is not a model or a backend.

The plan step is a single labeled call that must emit a whole JSON object
of templates, and it had the tightest budget in the file — 2000, below
even the 4096 the `question` capability ships with. A reasoning model
pays for its hidden tokens out of that same allowance, so on a rich
exploration trace it can spend the lot before the label. `PLAN_MAX_TOKENS`
is now 6000: the plan itself is a few hundred tokens and the rest is room
to think in.

A bigger number is not the fix, because no number is large enough for
every model. The fix is that the step now says what happened.
`run_labeled_step` strips the scratchpad on the way out — deliberately,
so a truncated one never reaches a reader — which left "starved
mid-thought" and "the model genuinely said nothing" as the same empty
string. `_parse_plan` read it as a plan of zero templates and phase 3,
which iterates them, emitted no questions and no error.

`LabeledStepResult.reasoning_only` separates them: no label ever arrived,
no text, no tool calls, and the model demonstrably did reason (inline
`<think>` or the provider's own channel). Tool calls disqualify it — that
round acted, it just did not narrate, and re-asking would repeat the
call. The plan step spends the signal on one more attempt with thinking
turned down, which is the same escape hatch Book already uses; its
`RETRY_REASONING_EFFORT` moved to `services/llm/reasoning_params` so the
choice of level, and why it is "low" and not "minimal", is stated once.

Every labeled step in the codebase now carries the flag, so `EXPLORE`,
`QUIZ` and `REPAIR` — which share the same exposure on smaller budgets —
are at least diagnosable. Whether an under-filled plan should warn or
fail is a separate question and is deliberately left where it was.
2026-09-10 23:05:52 +08:00
Bingxi Zhao (Frank)
4e816d7933 fix(tools): tell the model why a tool failed, not that it failed
Stop the Ollama a vector KB embeds against, ask a question, and the model
is told "An unknown error occurred while executing rag." The adapter had
already written the answer — `Cannot connect to Ollama at
http://localhost:11434. Make sure Ollama is running. Start it with:
ollama serve` — and the dispatcher was holding it (#1356).

`unknown_error_message_factory` took the tool name and nothing else, so
no caller could have done better. Four capabilities each wrote their own
message from that one argument and three of them called the result
unknown; the fourth, pageindex, restated the dispatcher's own default
minus the cause. The name was the bug: it presumed a cause the runtime
always had.

It is now `ToolErrorMessageFactory`, `(tool, cause) -> str`, and the key
plus the English wording live once in `tool_error_message_factory`, which
each capability wraps around its own `_t`. Capabilities keep their
translations and can no longer keep the cause out of them. pageindex
passes nothing and takes the default. A bundle predating the new
`notices.tool_error` key falls back to English rather than to silence
about what went wrong, which is the reason the fallback carries the cause
too.

This is the same shape as read_skill answering "skill not found" when the
skill resolved and only the file was missing (#1347): a failure the
caller cannot see has no way out, and the model spends its rounds
inventing one.

The regression test is the reporter's turn — a `rag` call raising the
real adapter error — and asserts the endpoint and the remediation reach
the role=tool message.
2026-09-10 23:00:11 +08:00
Bingxi Zhao (Frank)
5f7e165161 fix(llm): carry a round's reasoning through the shared agentic loop
DeepSeek's thinking models reject a continuation whose history has lost the
previous assistant turn's reasoning:

    The `reasoning_content` in the thinking mode must be passed back to the API.

Chat's loop has replayed it since #1058. The shared `runtime/agentic` loop —
the one quiz, research, PageIndex and explore_context all run on — never
did. `LabeledStepResult` had no field for it; the stream reader pulled
`reasoning_content` off each delta, pushed it to the trace UI for display,
and dropped it. All three assistant rebuild sites therefore emitted
reasoning-less turns. Round one cannot fail (system + user only); round two
always did, which is why this reads as "quiz generation failed".

The message builder's own docstring said as much: "The provider has always
known how to read this field off a message — nothing ever wrote it."

v1.6.5 made it visible rather than causing it. `deepseek-v4-flash` was in
`_THINKING_DISABLED_BY_DEFAULT_MODELS` in v1.6.4 and the list was emptied,
so the model now thinks by default — correctly, since suppressing reasoning
to dodge this cost every flash user their reasoning stream. `deepseek-v4-pro`
and `deepseek-reasoner` are sent `thinking: enabled` by our own code and were
already broken in v1.6.4. Re-adding flash to that list would hide it again
and still leave those two broken, so this fixes the replay instead.

The reasoning is accumulated for every label, not only the pre-label prelude
the trace happens to render — whether it was displayed is a display question,
and the provider wants the whole round back. Anthropic's signed thinking
blocks are read off `provider_specific_fields`, where the adapter puts them,
because a signature cannot be rebuilt from text. `_append_repair_messages`
now takes the step rather than its text, since a repair round is still a
round. Rounds with no reasoning append no field, so ordinary models see a
byte-identical history.

Deliberately NOT setting `_provider_response_state` alongside: the shared
loop posts its messages straight into `chat.completions.create` on what is
usually a raw AsyncOpenAI client, and the private-key stripping lives inside
`OpenAICompatProvider._sanitize_messages` — so it would be serialized into
the request body for every model off the adapter route.

Also reorders `_classify_failure`: a provider quoting the field it objected
to was landing in `prompt_leak`, which is not retryable and told the user the
model had leaked a prompt. `"prompt" in lower` goes with it — it matches
`prompt_tokens`.

Still open: `_sanitize_messages(responses_api=True)` ignores `reasoning_content`
entirely, so a surface that mounts native web search (which routes DeepSeek
to the Responses API) is not covered by this and falls back to Chat
Completions. The book quiz mounts no tools, so it is not that surface.
2026-09-08 00:52:57 +08:00
Bingxi Zhao (Frank)
04040a2c06 release: v1.6.5
Ship a content workspace you choose, one exec tool for every language,
Mastery Path modes that gate its tools, and Settings that grades
readiness instead of listing faults.

Release notes: assets/releases/ver1-6-5.md
2026-09-06 13:46:29 +08:00
Bingxi Zhao (Frank)
93df3d48b7 release: v1.6.4
Ship lighter isolated runtimes, richer Books and Mastery flows,
Reading/session polish, and explicit model API capabilities.

Release notes: assets/releases/ver1-6-4.md
2026-09-03 01:38:54 +08:00
Bingxi Zhao (Frank)
fc39543bc0 feat: integrate frontend backend and canonical routes 2026-09-01 22:24:29 +08:00
Bingxi Zhao (Frank)
02ba56793e chore: checkpoint backend stabilization workspace 2026-09-01 21:28:15 +08:00
Bingxi Zhao (Frank)
1b7643c558 Merge pull request #1067 from evan188199-tech
# Conflicts:
#	deeptutor/agents/chat/agent_loop.py
2026-08-31 19:00:32 +08:00
Bingxi Zhao (Frank)
bf32486f55 Merge pull request #1102 from contributor 2026-08-31 17:51:48 +08:00
Bingxi Zhao (Frank)
3dc372f551 release: v1.6.2 — immersive watching and extensible visualizers
Add synchronized YouTube learning, a plugin-driven visualizer catalog, and Hermes, OpenClaw, and DeepSeek agent harnesses. Refresh Reading, Knowledge, Partner status, guided updates, documentation, translations, and release notes for v1.6.2.
2026-08-31 01:13:07 +08:00
ZQR1101
e6f41b88a9 fix(agentic): distinguish empty vs missing tool args (#1101)
When a required string key is present but blank, tell the model it sent an empty value instead of framing it as omitted — thinking models otherwise retry the identical call. Also clarify obsidian_create_note.content must be non-empty.
2026-08-30 19:37:32 +08:00
Bingxi Zhao (Frank)
7d23ed8a28 merge: integrate video learning and WebVTT fixes
# Conflicts:
#	deeptutor/capabilities/registry.py
#	deeptutor/runtime/bootstrap/builtin_capabilities.py
#	deeptutor/services/session/turn_runtime.py
#	tests/core/test_capabilities_runtime.py
#	web/app/(workspace)/home/[[...sessionId]]/page.tsx
#	web/components/common/AssistantResponse.tsx
#	web/context/UnifiedChatContext.tsx
#	web/lib/settings-nav.ts
#	web/locales/en/app.json
#	web/locales/zh/app.json
2026-08-30 18:07:23 +08:00