Commit Graph

588 Commits

Author SHA1 Message Date
Bingxi Zhao (Frank)
d8ee0e5e40 Merge #2280 and regenerate router index 2026-11-06 02:04:52 +08:00
Bingxi Zhao (Frank)
8244eb3f59 Merge #2346 from rudycelekli 2026-11-06 01:56:40 +08:00
Bingxi Zhao (Frank)
b52aed6f70 Merge #2321 from FSOTM 2026-11-06 01:56:23 +08:00
Rudy Celekli
c77f888966 fix(api): honor a data: URL's declared MIME for quiz-answer images
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>
2026-11-02 00:44:23 -05:00
FSOTM
4fb9d78c99 fix(chat): confirm cancelled turn ownership before enabling another send 2026-11-01 22:55:21 +08:00
RRFZ
61e259b498 chore(api): refresh the router index after the knowledge router change
Regenerated with scripts/build_router_index.py; only the source fingerprint
changes, the indexed routes are identical.
2026-10-31 22:14:55 -04:00
RRFZ
d072a786fb fix(knowledge): name the clashing member when a zip upload is refused
safe_extract_zip refuses to replace a document the knowledge base
already holds, but _save_zip_archive let the FileExistsError escape, so
the upload failed with "Validation failed for file 'course.zip':
[Errno 17] File exists: '<absolute server path>/raw/chapter1.md'": an
OS error instead of a reason, and the server's directory layout handed
to the client.

Catch it next to the other archive rejections and say which member
clashes and what to do; still 400, the existing file still untouched.
2026-10-31 21:56:27 -04:00
AleFlyX
34c404228a fix(reading): keep document extraction off the API event loop
Immersive Reading extracts documents synchronously — an EPUB walks its whole
spine and a PDF renders every page through PyMuPDF — but the router called that
work directly from its async handlers. The API runs one event loop per worker,
so a document being opened or uploaded parked every other request: the session
title and transcript of the conversation being switched to, progress polling
and cancellation all waited behind the parse (#2054).

Run the upload extraction and the material detail build through
asyncio.to_thread, matching how the rest of this router and
capabilities/reading/tools.py already call the same store API.

Also load the outline once. _detail() read it, then render_outline() read it
again; for an EPUB whose stored rows still lack publisher anchors each read can
re-parse the whole package through _upgrade_epub_outline. Rendering is split
into format_outline(manifest, entries) so the rows already loaded are reused,
and render_outline() keeps its signature for existing callers.

Regenerated the router index fingerprint for the changed router source.
2026-11-01 00:58:00 +08:00
Bingxi Zhao (Frank)
4d7090447e Integrate Turkish across complete locale chain, runtime messages and desktop shell 2026-10-31 18:14:34 +08:00
Bingxi Zhao (Frank)
0e84ab77fa Integrate reviewed changes and complete Portuguese translations 2026-10-31 18:04:54 +08:00
Bingxi Zhao (Frank)
88b45d524d Integrate account typography with shared reply languages and current settings validation 2026-10-31 17:59:13 +08:00
Bingxi Zhao (Frank)
4b46d5f13e Integrate parser installation guidance with reviewed locales and stable continuity tests 2026-10-31 17:55:53 +08:00
Bingxi Zhao (Frank)
8f0a8ffd55 Merge reviewed integration chain and refresh knowledge router index 2026-10-31 17:53:57 +08:00
Bingxi Zhao (Frank)
55d92345bb Merge reviewed locale and settings fixes into password changes 2026-10-31 17:41:54 +08:00
Bingxi Zhao (Frank)
6d2026ee71 Merge reviewed PR #2207 and regenerate routing contracts 2026-10-31 17:39:41 +08:00
Bingxi Zhao (Frank)
fbab6f6a08 Merge reviewed PR #2174 and regenerate routing contracts 2026-10-31 17:37:43 +08:00
Bingxi Zhao (Frank)
c836ca354d Merge reviewed locale chain and preserve Vietnamese shared language selection 2026-10-31 17:32:10 +08:00
Bingxi Zhao (Frank)
b684df296d Merge reviewed French locale integration and refresh hint toggle contracts 2026-10-31 17:28:14 +08:00
Bingxi Zhao (Frank)
d002053ab9 Merge dev and refresh the API routing index 2026-10-31 17:26:35 +08:00
Bingxi Zhao (Frank)
3e281ce55b Complete and validate Brazilian Portuguese localization 2026-10-31 17:26:17 +08:00
Bingxi Zhao (Frank)
07db7024a7 Merge dev and refresh the French locale router index 2026-10-31 17:25:02 +08:00
Bingxi Zhao (Frank)
68c025ad66 Merge dev into Portuguese locale contribution 2026-10-31 17:21:05 +08:00
Bingxi Zhao (Frank)
42cf57bf96 fix(auth): scope password changes and expose temporary-password state 2026-10-31 17:15:58 +08:00
Bingxi Zhao (Frank)
1665df6936 Merge remote-tracking branch 'origin/dev' into codex/land-2179
# Conflicts:
#	web/locales/de/app.json
#	web/locales/en/app.json
#	web/locales/fr/app.json
#	web/locales/pl/app.json
#	web/locales/uk/app.json
#	web/locales/zh/app.json
2026-10-31 17:13:11 +08:00
Bingxi Zhao (Frank)
9476a1c4b4 fix(settings): preserve add-model drafts across catalog refreshes 2026-10-31 17:10:02 +08:00
Bingxi Zhao (Frank)
b47fca2cf2 build(api): refresh router index for hint settings 2026-10-31 17:08:07 +08:00
Bingxi Zhao (Frank)
71f29c03f7 fix(i18n): keep response language types in the shared language module 2026-10-31 17:02:27 +08:00
Bingxi Zhao
834bcf3f93 Merge pull request #2149 from KKandLL-Forever/fix/utf8-state-reads
fix: read state files with the writers' UTF-8 encoding
2026-10-31 16:46:05 +08:00
Rudy Celekli
83ffd625e7 chore(api): regenerate lazy router source fingerprint
Refresh the official router index after the restore endpoint exception handling changes. Route shapes and generated frontend schemas remain unchanged.
2026-10-31 02:05:22 -04:00
Rudy Celekli
520d1bf556 fix(library): report restore content conflicts without a server error
Translate only an actual active-SHA uniqueness conflict into a safe 409 response. Preserve both records and their bytes so restoring the earlier entry can be retried after deleting the replacement; unrelated database failures still propagate.

AI-assisted: implemented and validated with OpenAI Codex; isolated API and real SQLite constraints, no user workspace writes.
2026-10-31 01:53:57 -04:00
Antonio-Faure
28d86973a4 fix(i18n): complete the French catalog and follow it for partner replies
- add the 760 English keys missing from the French catalog and translate 229 values still copied from English\n- make a partner's empty reply language (Auto) follow the account model output language instead of hardcoding English\n- label Auto with the configured language and offer every supported response language in the picker\n- localize the Feishu thinking notice for every supported response language\n- add French catalog, picker and partner runtime regression tests
2026-10-30 18:02:55 +01:00
bcfernando
5c99a37096 feat(i18n): add Portuguese (pt) interface localization 2026-10-30 10:17:55 -03:00
yuleihaotong
35512dccff feat(auth): prompt users who still hold an admin-assigned password
Creating an account through the admin UI means the administrator picks the
password, so the owner starts life with a secret someone else knows. Nothing
in the UI said so: the password form existed, but nobody was sent to it.

- identity: accounts carry must_change_password, set on admin creation and
  cleared once the owner changes the password themselves
- POST /login returns the flag so the client can act on it right away
- GET /profile exposes it for the profile page
- web: after login, a flagged account goes straight to /profile, which shows
  why; the banner disappears once the change succeeds

Backend tests cover both directions: a successful change clears the flag, a
failed one (wrong current password) leaves it alone.
2026-10-30 17:44:24 +08:00
yuanyyt
58afb10b57 fix: harden tutor-thread source recovery
Persist a structured selection_source beside the assistant prompt, and use
the legacy sidebar prompt's containing message, role and selection to
disambiguate repeated text. Scan every user message for a quote, refuse to
guess between several, and make the backfill conditional so a concurrent move
or detach wins.

Serialize PocketBase preference merges with a lock that spans event loops,
not one asyncio lock per loop, and validate client-supplied anchors on turns
and organization updates. Detach threads when the message they point at is
deleted.
2026-10-30 15:55:21 +08:00
이정현
2de95b69cd fix(knowledge): return 404 instead of 500 for a missing knowledge base 2026-10-30 16:50:13 +09:00
yuanyyt
14292b808f feat: clear or move a tutor thread's source message
quoted_message_id now follows the create_target rule: the key's presence
is authoritative. A value moves the thread, an explicit null clears it,
and omitting the key leaves the stored anchor untouched. A new selection
moves the thread to the passage just asked about.

The message-level popover gains a detach action that clears the anchor
through the organization PATCH without deleting the conversation, and a
deliberate clear also stops the legacy backfill from re-attaching it.
2026-10-30 13:55:30 +08:00
yuanyyt
50f1d9f529 feat: recover the source message of legacy tutor threads
Threads created before the attribution existed kept only the passage:
selection threads store it in tutor_selected_text, newer side chats as a
quote attachment. Match that passage against the parent transcript with
the Markdown projection selection grounding uses, and record the source
only when exactly one message contains it.

The scan is recorded per thread and runs when the thread list is read,
so it happens once; touch=false keeps the thread's place in the list.
2026-10-30 13:55:29 +08:00
hongthana
cb9984d15c fix(settings): clarify offline parser installation guidance 2026-10-30 10:35:22 +07:00
yuleihaotong
1606c9e702 feat(auth): add password change endpoints and accept CJK usernames
Two gaps surfaced while running DeepTutor for a staff roster:

1. No endpoint changed a password. The service layer already had
   identity.set_password(), but nothing exposed it, so an account whose
   password was lost could only be fixed by editing users.json by hand.

   - PUT /api/auth/profile/password  (self-service, verifies the current
     password so a stolen session alone cannot take the account over)
   - PUT /api/auth/users/{username}/password  (admin reset, require_admin)

2. The username validator only accepted [A-Za-z0-9_-.]{3,64}, so real
   names such as 于冬阳 were rejected — with an error message that said
   'enter a valid email address', which pointed at the wrong problem.
   CJK-only names now allow two characters (张伟) where Latin usernames
   still require three (abc); the message names both accepted forms.
2026-10-30 10:14:56 +08:00
d41sys
9ddbb92c36 feat: add Vietnamese localization 2026-10-30 02:28:18 +01:00
hongthana
98cfb501a5 feat(web): add account-scoped learning typography 2026-10-30 07:41:44 +07:00
Bingxi Zhao (Frank)
e495fd6002 Merge origin/dev and reconcile creation contracts and replay tests 2026-10-29 18:13:47 +08:00
Bingxi Zhao (Frank)
01d7c0ed55 feat: add conversational creation drafts and refresh local dev UI 2026-10-29 18:11:52 +08:00
czc
f742fc2693 fix(settings): require a model ID and keep model panels URL-driven
- The Add model panel now asks for a model ID (prefilled from provider
  defaults and discovered models) and keeps Continue disabled until it is
  filled, so an unusable row can no longer reach the draft.
- The model editor marks a blank ID as required, explains it inline, and
  blocks "Set as default" until it is fixed.
- Apply now names the first incomplete model and opens the page and row
  that can repair it, instead of failing with a message pointing nowhere.
- Add/selection state lives in the URL, so refreshing no longer swaps the
  add panel for the list (or vice versa).
- Backend guidance points at the current page names (Language models /
  Embedding models / Search) instead of the removed Catalog page.
- Regression tests cover the add flow, URL state, editor validation, and
  the Apply preflight; new i18n keys for en/zh/de/pl/fr/uk.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-29 18:16:23 +09:00
wangkai
cbd925db0f fix(api,modules): read generated indexes as UTF-8
The lazy router index and pip --report plan.json are written as UTF-8,
but were read with the locale default; build_router_index.py now writes
UTF-8 explicitly so the read and write sides share one contract.
2026-10-29 13:33:14 +08:00
meconopscsh
877606fc2f feat: let learners turn off the chat composer's next-message hint
After each reply the chat composer shows a predicted next line as its
placeholder, and Tab accepts it. When the assistant has just asked a
question, such as a quiz in chat, the likeliest next line is the answer,
so the hint gives it away. There was no way to turn it off.

Add an `ask_hint_enabled` switch to the per-user starter settings
(Settings -> Conversation -> Composer), on by default. When it is off,
`get_ask_hint` returns an empty hint before reading the session or the
cache, so no LLM call is made and no line cached while it was on leaks
through.

A PUT that omits the field keeps the stored value, so an older client or
a settings draft saved before this change cannot turn the hint back on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 12:18:54 +09:00
Erhan ÜRGÜN
ff15bf084d feat(i18n): carry Turkish into the CLI, quiz judge, books, partners and voice
Earlier locales stopped at the settings lists, so these surfaces kept answering in English for them: the init wizard labels, quiz feedback, explicit book-language requests, book overview and export scaffolding, the partner and book language pickers, and the voice language list.
2026-10-29 01:05:43 +03:00
Erhan ÜRGÜN
e61181a4fc feat(i18n): add Turkish as an interface and reply language
Registers tr in every list that decides which languages exist: the reply-language whitelist and labels, the interface and launcher normalizers, the Settings choices, the web registry and lazy loader, the date locale, the response-language store and the API contract.
2026-10-29 01:05:32 +03:00
Bingxi Zhao (Frank)
2c47cc22ce fix(integration): authenticate search and regenerate route contracts 2026-10-29 01:19:18 +08:00
Bingxi Zhao (Frank)
f50ab3afb0 Merge pull request #2050: inspect and clean generated files 2026-10-29 01:10:37 +08:00