The first visit stored the detected palette and never listened for
prefers-color-scheme changes, so the theme stopped tracking the OS and
Settings had no System choice.
Do not write that fallback. Subscribe while the preference is missing or
"system", and add a System option in Appearance. New accounts default to
system so Apply does not freeze the snow palette.
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.
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
* feat: separate UI and model response languages
* refactor(settings): keep one owner for the interface.json language rules
The legacy migration — a file written before the UI/response split
inherits its single language into both fields — had been duplicated into
both readers of interface.json, as had the theme/language defaults. Two
copies of a migration rule drift.
Move the rule into resolve_languages() in the module that owns the file,
have the router compose its superset of defaults on top of the service's,
and cover the agreement with a test that reads one legacy file through
both paths. The helper also drops the separate key-presence check:
_normalize_language already falls back to its default for missing, null
and unrecognized values alike.
* fix: keep the language bootstrap single and local-choice-first
Merging dev surfaced three collisions this branch had not seen:
- The new bootstrap fetched /settings/ui unconditionally and overwrote
writeStoredLanguage on every mount, undoing #730's rule that a choice
made in this browser is the more specific signal and must win. Folded it
into the existing guarded effect so one fetch serves both language
fields and neither can clobber a local selection.
- apiFetch/apiUrl ended up imported twice in AppShellContext, which git
merged without a conflict and tsc rejects outright.
- Three tests still stubbed get_ui_language at call sites that now ask for
get_response_language: the question router's stand-in module and two
mastery_path patches (renamed the zh case to say response language).
* fix(api): include response_language in the pre-session UI read
The bootstrap adopts both languages from this one endpoint, so leaving
response_language out of the projection meant a fresh browser always
inherited the interface locale and never saw the saved output-language
preference. It belongs with the other two: all three are the visitor's
own presentation choices, none describe the deployment.
---------
Co-authored-by: Bingxi Zhao (Frank) <13051345080@163.com>
The interface language is persisted in the backend's ui settings, but only the settings route ever read it into state — so /home and every other page started in English until the user picked the language again in that browser.
The app shell now adopts the saved value once after mount, and only when the browser has recorded no choice of its own, so a local selection still wins. It goes through apiFetch (works with auth enabled), leaves the routes statically prerendered, and keeps the zh locale a lazy chunk.
Also replaces the duplicated "New conversation" sentinel check with a shared helper — the chat header showed the untranslated English sentinel the same way the sidebar did — and adds three composer aria-label keys that were referenced but missing from both catalogs.
Closes#729.
Pre-commit auto-fixes from the project's pinned prettier (alpha.8).
Pure formatting — long object/array literals and assert.equal() calls
broken across multiple lines to satisfy print-width. No logic changes.
Files: code-block-themes registry, RichCodeBlock renderer, AppShell +
SettingsContext plumbing, appearance settings page, and the 6 affected
test files. Also adds a missing trailing newline to
app-shell-storage-code-block.test.ts.
Add a registry of every installed Prism theme (46 options) using
individual module imports rather than the barrel, plus type
declarations for the style modules. Extend AppShell storage and
context so code-block preferences are available synchronously to
renderers outside /settings/*. Sync backend-loaded values from
SettingsContext into AppShell storage and add update helpers that
PUT only the changed field.
Move localStorage/sessionStorage helpers out of AppShellContext into a
standalone client module so non-context callers can import them without
pulling in the full provider, and wrap BookPage in a Suspense boundary
to satisfy Next.js useSearchParams() CSR bailout during static prerender.
Made-with: Cursor
- Replace litellm with native openai + anthropic SDKs across both
services and tutorbot layers
- Add 5 new providers: mistral, stepfun, xiaomi_mimo, qianfan, ovms
- Add `backend` field to ProviderSpec for SDK routing
- New TutorBot OpenAICompatProvider (openai SDK) and AnthropicProvider
(anthropic SDK), replacing LiteLLMProvider
- Rewrite services/llm/executors.py to use openai SDK directly
- Remove litellm from factory.py routing, token_tracker, provider_cmd
- Auto-fallback to streaming for tool-call format errors (fixes#265)
- Settings UI: provider dropdown with auto base-url fill
- Clean up litellm from requirements/cli.txt and pyproject.toml
Made-with: Cursor