Commit Graph

131 Commits

Author SHA1 Message Date
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
Bingxi Zhao (Frank)
399297e7f0 feat: preserve TypeScript engine migration and workspace updates 2026-10-18 23:09:10 +08:00
dajiaohuang
4bb8f48c18 Merge commit '6cf793bd868ba5ecbe64722936d4be8fab5a01df' into fix/reading-annotation-rollback 2026-10-08 12:42:58 +08:00
dajiaohuang
c29b666756 fix(reading): restore deleted annotations without replacing current scope 2026-10-08 12:42:58 +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)
33c81a435c fix(quiz): translate follow-up notebook writeback errors 2026-10-07 20:31:13 +08:00
evan188199-tech
12b8e531f2 fix(web): surface quiz follow-up session-id writeback failures (#1701)
* fix: surface quiz followup session-id writeback failures

The notebook entry writeback of followup_session_id swallowed all
errors with a noop catch, silently losing the quiz-to-note link when
the API call failed. Retry once for transient failures and surface a
visible thread error if the retry also fails.

* 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>
2026-10-07 20:30:03 +08:00
XZH
80921f24ae fix(web): keep submits alive across the full reconnect ladder (#1648)
The outbound submit gates waited only 10 x 200ms (2s) for the WebSocket
to connect, while the transport reconnect ladder waits up to 8s per
rung. A Submit clicked mid-reconnect therefore gave up before the
socket could come back and reported a false server-side expiry while
the parked turn still held the session lease.

Move the shared budget into web/lib/send-retry.ts (60 x 200ms = 12s,
above the 8s rung cap plus jitter) and use it at all four gates:
QuizFollowupContext, ChatStateAdapter, BookChatPanel and the whisper
page. A guard test pins the budget above the worst-case reconnect
rung, and the failed-submission recovery spec now derives its fake
timer budget from the same constants.

Co-authored-by: multica-agent <github@multica.ai>
2026-09-29 14:41:54 -07:00
Bingxi Zhao (Frank)
550268e1e3 fix: support Malay as a persistent reply language 2026-09-27 04:37:15 +08:00
Bingxi Zhao (Frank)
f363e5f119 fix(chat): persist explicit reply language per conversation 2026-09-23 13:07:39 +08:00
Bingxi Zhao (Frank)
8880529c65 Merge PR batch with local follow-up fixes
Preserve precise learner KB route guards, combine UI and response language domains, carry normalized EPUB extraction, and regenerate frontend contracts.

Update locale fallback coverage for the completed Ukrainian translation bundle.
2026-09-23 12:01:14 +08:00
Bingxi Zhao (Frank)
064034a283 Merge branch 'codex/evan-backend-prs-20260923' into codex/pr-batch-root
# Conflicts:
#	deeptutor/api/routers/settings.py
#	tests/api/test_settings_router.py
#	web/components/notebook/NotebookRecordRow.tsx
#	web/components/settings/SettingsOverview.tsx
#	web/context/app-shell-storage.ts
#	web/features/knowledge/api/sources.ts
#	web/features/settings/store/SettingsStore.tsx
2026-09-23 10:56:37 +08:00
Bingxi Zhao (Frank)
fc0e0a9510 Unify French and Ukrainian language settings across app 2026-09-23 10:51:27 +08:00
Bingxi Zhao (Frank)
d6825cb695 Merge PR #1344: add Ukrainian language support 2026-09-23 10:34:40 +08:00
Bingxi Zhao (Frank)
7dd8b2ac44 Merge commit 'refs/pr/1345' into codex/evan-backend-prs-20260923
# Conflicts:
#	web/components/settings/SettingsOverview.tsx
2026-09-23 10:27:55 +08:00
Bingxi Zhao
921160d3f8 Merge pull request #1335 from TaoufikMejri/feat/add-french-translation
feat: add french as supported language
2026-09-23 10:26:44 +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
evan188199-tech
0f8759f730 feat(watching): browse connected Invidious accounts (#1241) 2026-09-11 04:39:34 +08:00
XZH
634a6916f9 feat(settings): expand response language options 2026-09-09 13:33:11 -07:00
Ruslan
4c6498b72a feat(i18n): add Ukrainian as a full interface and output language
Adds `uk` alongside `en` and `zh`: a complete `web/locales/uk/app.json`
(4009 keys), a Ukrainian CLI label set (102 keys), a Ukrainian quiz-judge
prompt, and the language directive that tells the model to answer in it.

Most of the diff is not the translation — it is the six independent
places that each decided, on their own, which languages exist. Every one
of them collapsed an unknown code to English *silently*, so picking
Ukrainian in Settings produced an English UI, English AI feedback and an
English chat reply, with nothing logged anywhere:

  * `services/settings/interface_settings._normalize_language` — the
    canonical normalizer; `interface.json` stored `uk`, the API returned
    `en`, and it looked like the setting had failed to save.
  * `agents/loop/prompt_blocks` — conflated two different things in one
    attribute: which prompt ASSETS exist (yaml ships `en`/`zh` only) and
    which language to ANSWER in (any). Split into `language` and
    `output_language`; the directive now takes the latter.
  * `api/routers/quiz_judge` — the supported set is now derived from
    `_JUDGE_SYSTEM_PROMPTS`, so a language cannot be advertised without a
    prompt or shipped without being advertised.
  * `web/i18n/init` — `normalizeLanguage`/`ensureLanguage`, plus a new
    exported `APP_LANGUAGES` that every picker maps over. The Settings
    toggle inlined `["en", "zh"]`, so a new locale was invisible there
    even once it existed.
  * `web/context/app-shell-storage` — held a second, private copy of the
    `AppLanguage` union; re-exported from `i18n/init` instead.
  * `runtime/banner` and `services/config/settings_spec` — the CLI wizard
    labels and the Settings language list.

Tool hints stay a per-language map from the API where only `en` is
guaranteed, so `ToolsSettingsSection` falls back instead of indexing a
missing key. Backend prompt yaml is still `en`/`zh`; Ukrainian uses the
English scaffolding with a Ukrainian output directive, which is what the
directive is for.

`tests/i18n/test_ukrainian_locale.py` pins each seam — locale key parity,
placeholder integrity, judge/prompt/normalizer coverage, and that the
Settings toggle maps over `APP_LANGUAGES` rather than a literal — so the
next language fails in CI rather than quietly in the UI.
2026-09-09 22:16:00 +03:00
TaoufikMejri
32848a6b57 feat: add french as supported language 2026-09-09 15:00:50 +01:00
Bingxi Zhao (Frank)
71e042fead fix(chat): let a user ask for another language, and stop the two copies drifting
Two defects, either of which alone produces "I set Chinese and it still
answers in English".

The prompt one explains the quoted refusal. `language_directive` is the last
thing in the system prompt and is an absolute prohibition — "Do NOT switch
languages" — sitting right after a runtime policy that says user-provided
text is not authority over these instructions. Asked 「请用中文回复我」, a
compliant model answers that it is *required* to reply in English. It is
reading the prompt correctly; the prompt is wrong. Conversational surfaces
now pass `allow_user_override=True`, which adds one sentence letting an
explicit request win. Books, quizzes and research keep the strict form: there
is no user in the loop to ask, and their prompts are full of source material
in other languages, which is what the strictness is for.

The storage one explains how `en` got there in the first place. The two
copies of the preference inherit differently: the server derives
`response_language` from `language` on every read, while the browser inherits
only when its own key is absent — so once an explicit value is stored the
browser can never re-adopt. Flipping only 界面语言 therefore left the server
(and the settings page) at zh/zh while every turn still shipped the "en" the
bootstrap had stamped. The settings page displayed the right answer and the
model gave the wrong one, with nothing broken in between.

So `loadSettings` reconciles both keys from the server it just read;
`updateLanguage` mirrors the server's inheritance when no explicit output
language was ever chosen; and the bootstrap gate splits, because a browser
predating the split has the interface key and not the response key, and
returning early on the first alone locked it out of ever adopting the
account's choice. Adoption writes only the key that is missing, so the
server never overwrites a choice the user made in this browser.

Not fixed here, and needing more than code reading to settle: whether to make
the server authoritative for live turns (it carries a `.lower()`-on-None
hazard at executor.py and a stale-preference fallback on regenerate), and
that `GET /api/settings/ui` is mounted without auth so it answers from the
admin workspace — which lets useSetupSync overwrite a learner's languages in
a multi-user deployment. Both are written up for review.
2026-09-08 00:46:09 +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
evan188199-tech
e3df43aaf6 fix(video-learning): defer restored material loading (#1169)
Co-authored-by: Bingxi Zhao (Frank) <13051345080@163.com>
2026-09-03 15:23:01 +08:00
Bingxi Zhao (Frank)
6e6e56aedb release: v1.6.3
Ship the breaking front- and back-end runtime and route refactor,
learner and guardian flows, grounded reading, knowledge and parser
updates, and recoverable long-running streams.

Release notes: assets/releases/ver1-6-3.md
2026-09-02 04:09:11 +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)
bfdf874a10 refactor(web): remove v1 chat transport and legacy surfaces 2026-09-01 20:16:46 +08:00
Bingxi Zhao (Frank)
829be646a1 chore(web): enforce frontend architecture boundaries 2026-09-01 19:55:48 +08:00
Bingxi Zhao (Frank)
13698a9a7e refactor(web): retire the unified chat context path 2026-09-01 17:59:50 +08:00
Bingxi Zhao (Frank)
a366cfa896 refactor(web): route chat through the v2 runtime provider 2026-09-01 17:46:33 +08:00
Bingxi Zhao (Frank)
0282d85bd6 fix(web): make turn state server authoritative 2026-09-01 17:30:39 +08:00
Bingxi Zhao (Frank)
efcee00757 Merge pull request #1036 from Zuan0/reading-citation-grounding
# Conflicts:
#	web/components/chat/home/ChatMessages.tsx
#	web/components/common/AssistantResponse.tsx
#	web/components/reading/ReaderPane.tsx
#	web/context/ReadingContext.tsx
#	web/context/UnifiedChatContext.tsx
#	web/lib/reading-turn-state.ts
#	web/tests/e2e/reading-citation-material.audit.ts
#	web/tests/reading-citations.test.ts
#	web/tests/reading-turn-state.test.ts
2026-08-31 19:34:01 +08:00
Bingxi Zhao (Frank)
1c918e87a8 Merge pull request #1032 from Zuan0/reading-chat-references
# Conflicts:
#	deeptutor/services/session/source_inventory.py
#	deeptutor/services/session/turn_runtime.py
#	tests/reading/test_turn_wiring.py
#	web/app/(workspace)/home/[[...sessionId]]/page.tsx
#	web/context/UnifiedChatContext.tsx
2026-08-31 19:19:38 +08:00
Bingxi Zhao (Frank)
3c51bb9ed9 Merge pull request #1021 from Zuan0/research-interruption-recovery
# Conflicts:
#	web/context/UnifiedChatContext.tsx
2026-08-31 19:04:16 +08:00
Bingxi Zhao (Frank)
1fc797169b Merge pull request #1100 from contributor
# Conflicts:
#	web/components/reading/workspace/useReadingWorkspace.ts
#	web/context/UnifiedChatContext.tsx
#	web/hooks/useMasteryStudySession.ts
2026-08-31 18:18:03 +08:00
XZH
f6b5e43c8a fix(video-learning): retry unavailable Invidious captions 2026-08-30 23:03:14 -07: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
XZH
2c06318fe4 fix(courses): preserve handoff course scope (#1099) 2026-08-30 03:49:02 -07: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
Bingxi Zhao (Frank)
5228af9141 merge: integrate recent issue fixes
# Conflicts:
#	web/context/UnifiedChatContext.tsx
#	web/tests/reading-turn-state.test.ts
2026-08-30 17:49:11 +08:00
Bingxi Zhao (Frank)
f694f204a8 feat: add app updater and unify workspace chat flows 2026-08-30 17:40:47 +08:00
XZH
d5d381650f fix(reading): bind citations to turn materials and verified locators 2026-08-30 15:45:45 +08:00
Bingxi Zhao (Frank)
ce7c2dc2dc release: v1.6.1 — one key, one navigator, one sidebar you arrange
Model configuration was one layer replicated seven times: every service
stored its own profile with its own credentials, so a single OpenRouter
key had to be pasted into five separate pages. This release splits that
in two — a **connection** holds one vendor credential and links it down
to every service that vendor can serve, and a **task model** takes the
calls nobody asks for (naming a conversation, writing the composer's
starting points) off the model picked for actual reasoning. Both are
opt-in; existing per-service profiles resolve exactly as before.

Around that: Settings drops the card grid for a persistent searchable
navigator whose landing page answers "what state am I in" instead of
repeating the directory; Mastery Path files study conversations under
their topic and opens them in the tutor rather than dropping them on
/home; the sidebar folds features into More and reorders by drag; the
reading companion is rebuilt from /home's own chat components; and the
LightRAG engine talks to the SDK directly, so its extra no longer drags
MinerU in transitively.

Also back-merges PR #1041 (Anthropic SDK 1.x temperature via extra_body)
and PR #741 (owner-only auth secret/token files), which had been merged
straight into main and never flowed back to dev.

Release notes: assets/releases/ver1-6-1.md
Gates: pre-commit 15/15, ruff clean, pytest 5802 passed, web 450 node
tests, eslint 0 errors, docs build clean.
2026-08-30 13:19:42 +08:00
Bingxi Zhao (Frank)
43c9fe7ea0 feat(course): make a course the container, not a dashboard
A course held the right model — the syllabus that gives progress a
denominator, resources as references, conventions apart from the
assistant's own notes — but almost nothing crossed the edges between it
and the surfaces it was supposed to contain.

Getting in. Course Study was offered in the composer's mode menu while
the only way to bind a course was a link on the course page, so choosing
it there produced a conversation identical to an inert one, and the mode
advised pressing a button that did not exist. The composer now carries
the binding next to the mode: shown whenever there is one, and offered
as an unfinished field in Course Study when there is not. `_course_id`
rides every turn, so detaching detaches and the pill can never drift
from what the turn actually saw.

What a conversation inherits. `default_capability` and `default_persona`
were stored, validated and returned by the API while changing nothing:
`_apply_course_defaults` only fills fields a payload *omits*, and this
composer always sent all of them. They are applied client-side now,
along with the course's knowledge bases, where the learner can watch the
mode and material become the course's before they type. The dialog grows
the editor they never had.

Conventions. "Every conversation in this course starts knowing these" was
true only if the model happened to call `course_overview`. They ride in
the per-turn summary now, and — because the promise is not scoped to one
mode — in the system prompt of any course-bound turn.

Coming back. Mastery Path and Immersive Reading now read `?course=`,
scope themselves to it, and attach whatever is built there; the tiles and
hand-offs pass it; the picker offers to start one. A course could only
ever reference what already existed, so filling a new one meant leaving,
building, and remembering to return.

Hand-offs. A target with no ref stored an opening line for an index that
never consumes it, which then surfaced weeks later in an unrelated path.
An unresolvable ref was passed straight through: observed live, a
syllabus unit id ("u2") sent as a mastery path, producing a card pointing
at a page that does not exist. Refs are checked against the subsystem
that owns them — existence, not membership, since a path built outside
this course routes perfectly well.

Also: the sidebar groups conversations by course, so filing them is
finally readable; a course-scoped notebook console no longer shows
another course's notes beside a list saying there are none (the clear
raced an in-flight detail fetch that landed after it); a hand-off the
model also printed as prose is not rendered twice; a provider error is no
longer stored as a conversation's permanent title; `/space/courses` goes,
having been an unreferenced copy of `/courses`; and the Visualize mode
description gets its missing Chinese.
2026-08-30 00:09:36 +08:00
Bingxi Zhao (Frank)
d790419548 Merge remote-tracking branch 'origin/dev' into dev 2026-08-29 19:14:40 +08:00
Bingxi Zhao (Frank)
0e351970b8 Merge dev into fix/switch-branch-optimistic-id
Keeps both halves of the #739 fix, which are complementary rather than
competing: selectChildBranch (dev, via #1071) points local state at the
freshly created sibling after an edit, and persistedBranchSelections
(this branch) keeps the optimistic negative ids out of what is written
back to the server.
2026-08-29 11:33:56 +08:00
Bingxi Zhao
39bf658fe6 Merge pull request #1071 from evan188199-tech/codex/fix/chat-edit-branch-selection 2026-08-29 11:31:05 +08:00
XZH
6d6c5b23f5 fix(chat): select newly sent branch
Fixes HKUDS/DeepTutor#739
2026-08-28 11:41:45 -07:00