Commit Graph

630 Commits

Author SHA1 Message Date
Bingxi Zhao (Frank)
8ab4ecfee9 feat(books): review and undo scoped chapter and section edits
Fixes #2571
2026-11-15 01:42:47 +08:00
Bingxi Zhao (Frank)
ce4434e75a fix(workspaces): reuse knowledge references in selective conversation moves
Fixes #2289
2026-11-15 01:42:46 +08:00
Bingxi Zhao (Frank)
53bc9eb99d fix(learning): paginate and search question bank sources
Fixes #2641
2026-11-15 01:20:53 +08:00
Bingxi Zhao (Frank)
8ecf2da95f fix(parsing): validate uploads against available parser formats
Fixes #2338
2026-11-15 01:20:52 +08:00
Bingxi Zhao (Frank)
b46d9b5763 fix(mcp): reconnect after consent and refresh authorization status
Local dev repairs for #2586.

OAuth owner isolation and refresh-token stability verified. Hook polls until connected, refreshes on focus and stops on unmount. Python rechecks: 56 passed; UI batch: 25 passed. Web typecheck, 1407 Node tests, eslint and i18n passed.
2026-11-15 00:50:30 +08:00
Bingxi Zhao (Frank)
3a533c6c5f fix(auth): allow chat learners to record and play voice
Local dev repairs for #2437.

Guarded voice endpoints and negative permissions tested in the 375-pass first batch.
2026-11-15 00:50:30 +08:00
Bingxi Zhao (Frank)
47ae8a27e4 Merge PR #2515: feat(i18n): add Hungarian as an interface and reply language
Combine Hungarian with Italian UI and Hindi reply-language registries; translate 49 newly integrated keys and add the Hungarian endonym to Italian. Regenerate router and frontend contracts. 33 Python locale tests, full Node suite and locale parity pass.
2026-11-14 23:36:26 +08:00
Bingxi Zhao (Frank)
95aa81d624 Merge PR #2544: feat(i18n): add Italian (it) localization
Make Italian quality tests compatible with CommonJS Node test compiler; accept Italiano as reply-language alias; translate 48 keys added by other integrated PRs; regenerate router index and format i18n. 26 Python locale tests and full Node suite pass.
2026-11-14 23:34:48 +08:00
Bingxi Zhao (Frank)
af403550ce Merge PR #2639: fix: explain missing LLM access in chat
Retain admission error text and localized model-access guidance; allow explicit retry to revalidate access instead of permanently blocking stored messages. No automatic retry on reload. Backend tests and both manual retry paths passed.
2026-11-14 23:19:09 +08:00
Bingxi Zhao (Frank)
2d493edb84 Merge PR #2521: feat(i18n): add Hindi as a reply language
Regenerate the lazy route index after the reply-language contract changes; targeted tests passed.
2026-11-14 23:16:33 +08:00
Bingxi Zhao (Frank)
33078edd49 Merge PR #2542: fix: register connected knowledge bases in the viewing workspace
Regenerate the lazy route index after workspace registration changes; targeted API tests passed.
2026-11-14 23:16:29 +08:00
Bingxi Zhao (Frank)
9934fb15ca Merge PR #2625: feat(book): post-generation chapter CRUD without recompiling
Validate chapter existence, spine presence, and protected overview deletion before claiming a revision; cover failed edits followed by valid retries (22 passed).
2026-11-14 23:11:57 +08:00
Bingxi Zhao (Frank)
3fc9d2ce18 Merge PR #2534: feat(web_fetch): pluggable fetch backend with DeepSeek Fetch as first alternative
Combine independent locale additions and regenerate integrated route index.
2026-11-14 23:00:23 +08:00
Bingxi Zhao (Frank)
68220257af Merge PR #2568: feat(guardian): show scoped Reading progress and quiz records
Combine independent locale additions and regenerate integrated route index.
2026-11-14 23:00:03 +08:00
Bingxi Zhao (Frank)
c60e0e0331 Merge PR #2576: feat(reading): record question-linked help without replacing the quiz
Keep server-only quiz answer keys before persisting help results; retain relationship and extension-policy revalidation.
2026-11-14 22:59:16 +08:00
Bingxi Zhao (Frank)
fa3debf4b4 Merge PR #2560: fix(reading): keep quiz answer keys on the server 2026-11-14 22:58:53 +08:00
Bingxi Zhao (Frank)
a768f739a2 Merge PR #2578: fix(book): don't advance revision when refresh-fingerprints is refused 2026-11-14 22:58:50 +08:00
Bingxi Zhao (Frank)
d76a4cbe7e Merge PR #2526: fix: resolve workspace KB scope past dead registrations; keep the progress stream off the activity lease
Regenerate the lazy router index against the integrated route sources.
2026-11-14 22:58:00 +08:00
Bingxi Zhao (Frank)
f691217179 Merge PR #2589: fix(mcp): pass the server name into the OAuth store during Test
Regenerate the lazy router index against the integrated route sources.
2026-11-14 22:57:40 +08:00
Bingxi Zhao (Frank)
54324f8318 Merge PR #2674: fix: reject partner session branches that already exist
Preserve both image-only partner history coverage and existing-destination validation tests; combined partner suite: 146 passed.
2026-11-14 22:57:24 +08:00
qq1069730908
9bc95d6bee fix: regenerate router index for chat patch 2026-11-14 20:06:58 +08:00
mpichini1
48e1e66c23 fix(api): refresh partner router index fingerprint 2026-11-14 10:14:47 +01:00
mpichini1
44dee85814 fix: reject partner session branches that already exist 2026-11-13 19:26:35 +01:00
mpichini1
64626e3015 fix: deliver task stream terminal events when subscriber queues fill 2026-11-13 19:14:00 +01:00
Junlin Li
560a80a17f fix: explain missing LLM access in chat 2026-11-12 16:58:52 +08:00
ZQR1101
e2d16b5b5e chore(book): regenerate router index for the chapter CRUD endpoints
Adding the four chapter routes changed the router source fingerprint, so
the tracked lazy-routing index must be rebuilt via scripts/build_router_index.py
to keep test_repository_index_matches_router_sources green.
2026-11-11 20:45:37 +08:00
ZQR1101
71a05602d5 feat(book): post-generation chapter CRUD without recompiling
Add / rename / reorder / delete chapters after generation through REST
endpoints mirroring the block-CRUD handlers. New chapters are pending
shells; already-compiled pages are never recompiled or discarded. Each
edit carries the chapter's order/title onto its pages so the reader-visible
sequence follows, and delete prunes only its own pages plus the concept
graph, prerequisites, and progress refs.

Part of #2571
2026-11-11 17:45:37 +08:00
evan188199-tech
4847abff1b chore(api): regenerate router_index after the MCP Test name fix (#2587)
Signed-off-by: evan188199-tech <238371241+evan188199-tech@users.noreply.github.com>
2026-11-10 16:06:32 +08:00
evan188199-tech
585d7656c7 fix(mcp): pass the server name into the OAuth store during Test (#2587)
POST /api/space/mcp/servers/{name}/test discarded the path name, so a
probe of an OAuth-backed server built its token store with '' and every
Test answered "ValueError: Unsafe MCP server name for an OAuth store: ''"
— including for a server that was authorized and connected.

probe_server now takes a server_name (the name the saved connection
would address the grant under) and the space router passes the path
name for OAuth configs. A scratch name no grant could live under (an
unnamed draft) is answered the way an unauthorized server is instead of
the store's refusal; non-OAuth probes stay nameless as before.

Fixes #2587

Signed-off-by: evan188199-tech <238371241+evan188199-tech@users.noreply.github.com>
2026-11-10 15:35:07 +08:00
evan188199-tech
b04ac1bbc0 fix(book): run refresh-fingerprints refusal gate before claiming revision
A rejected POST /api/books/{id}/refresh-fingerprints (force=false, stale
pages not yet recompiled) bumped and persisted book.revision before the
engine refused it, so the client's expected_revision went stale and the
force=true retry always lost the revision race (409 forever).

Run the engine's refusal check (new read-only preflight
check_refresh_kb_fingerprints -> ensure_can_refresh_fingerprints) before
_claim_content_mutation; a rejected dismissal is now side-effect free and
the force retry with the same expected_revision succeeds. Regenerate the
router index fingerprint.
2026-11-10 00:47:45 +08:00
Yin
caee2c5ff6 feat(reading): persist question-linked help receipts and events 2026-11-10 00:12:58 +08:00
Yin
a420707623 feat(guardian): show scoped reading progress and quiz records 2026-11-09 23:07:32 +08:00
Yin
9e4db3c292 fix(api): synchronize router index after quiz response change 2026-11-09 22:45:38 +08:00
Yin
5d16a6a2f0 fix(reading): keep quiz answer keys on the server 2026-11-09 22:17:03 +08:00
Daniele Lucarelli
377bf10fa9 feat(i18n): add Italian (it) localization 2026-11-09 08:48:31 +00:00
evan188199-tech
aaf19c6352 fix: regenerate router_index after web-fetch settings routes (#2448) 2026-11-09 16:47:49 +08:00
evan188199-tech
91104d9a3f fix(web_fetch): settings UI for backend + harden DeepSeek fetch cap (#2448)
Addresses Air R1/R2 review blockers on top of the opened PR head:
Settings GET/PUT /api/settings/web-fetch with UI control; DeepSeek fetch
uses identity encoding, raw bytes, and capacity checks before buffer extend;
provider-branding treats `local` as generic.
Air Codex R3 on MacBook Air: READY.
2026-11-09 16:23:50 +08:00
zhang.kom
152c00ca58 fix: register connected knowledge bases in the viewing workspace 2026-11-09 16:00:04 +08:00
denghui996
0902053a12 fix: do not hold the workspace activity lease across a progress stream
The authenticated-request dependency takes a shared lease on
workspace-activity.sqlite3 for the whole ASGI call, and the middleware
releases it when that call returns. A streaming response only returns when
the stream ends, so an indexing-progress SSE held the lease for as long as
its tab stayed open -- and when the indexed task never starts (see the
preceding commit) that is indefinitely.

Every exclusive workspace operation (KB move, registration update, data
migration) then answered 'Workspace data is busy' until the backend was
restarted, because acquire_activity() uses timeout=0 and a leaked shared
lock never expires.

Task-board events and the calendar stream were already excluded for this
reason; the knowledge-base task progress stream reads only in-memory task
state and is equally safe to exclude. A failing task therefore no longer
locks the workspace it cannot even reach.

Regenerate the router index for the changed router sources.

Fixes #2525
2026-11-09 02:07:08 +08:00
denghui996
d39b470d91 fix: resolve a KB's storage scope past unreadable workspace registrations
workspace_id_for_kb_base_dir() walks every registered workspace to find the
one that owns a KB directory, and it runs on every upload, folder sync and
reindex. A registration whose folder no longer exists (archived leftovers, a
directory the user moved) raises WorkspaceError on entry, which aborted the
whole lookup and dropped the storage scope from the background task.

Because WorkspaceError is a ValueError, the upload/sync routes then answered
404 'Knowledge base <name> not found' for a KB that exists, the background
task was never registered (the call sits in add_task's argument list), and
the KB kept the progress entry written just before it, so the UI showed an
endless 'scanning' state with no error on disk.

- skip registrations that cannot be entered instead of aborting the scan
- resolve the scope before copying files or marking the KB queued, so a
  failure cannot leave a task-less progress entry behind
- surface WorkspaceError as 409 with its real message instead of a 404

Fixes #2524
2026-11-09 02:07:05 +08:00
Arrunabh Singh
b0bf8cf2d4 feat(i18n): add Hindi as a reply language
Add Hindi (hi, हिन्दी) to the reply-language contract, following step 4
of docs-for-dev/I18N.md and the earlier Malay change (550268e1):

- SUPPORTED_RESPONSE_LANGUAGES, the settings router's ResponseLanguage,
  the prompt-language label and the settings-spec reply choices;
- "hindi", "हिन्दी" and "हिंदी" aliases in the backend and web
  normalizers (hi-IN and hi_IN resolve through the base code);
- the web ResponseLanguage type, isResponseLanguage() and
  RESPONSE_LANGUAGE_OPTIONS, which the partner picker shares;
- regenerated frontend contracts, and tests mirroring the Malay change.

The interface language is unchanged: no web catalog or picker entry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 18:24:54 +05:30
gezakepek-tech
adc80e5038 feat(i18n): add Hungarian as an interface and reply language
Adds a complete Hungarian (hu) locale alongside the existing catalogs, wired
through every seam a language has to pass so none of them silently serves
English to a Hungarian reader.

Frontend: the hu catalog covers all 6,584 English keys with matching
interpolation placeholders, registered in the locale registry, the lazy bundle
loader, Intl date/number formatting (hu-HU) and the reply-language picker.
`language.hungarian` ("Magyar") is added to every existing catalog so the
endonym is shown whatever the current interface language is.

Backend: "hu" is accepted by the launch, interface and reply-language
normalizers and offered in both settings choice lists, named in the prompt
language labels, and carries the Hungarian copy of the CLI-app, MCP and
sandbox messages, the quiz-judge prompt, the book export labels, the book
overview front page and the voice language list.

Scope: the CLI installer banner (`deeptutor/runtime/banner.py`) keeps its
English text for hu and falls back through `_pick_language`; it is terminal
setup copy unused in server deployments and is left for a follow-up.

Evidence:
- `python -m pytest tests/i18n/test_hungarian_locale.py` — 33 passed
- `npm run test:node` — 1353 passed (adds hungarian-locale-quality.test.ts)
- `npm run typecheck` — clean
- `node scripts/i18n_parity.mjs` — OK
- `node scripts/i18n_audit.mjs` — hu: 4529/4529 used keys (100.0%), strict
- `node scripts/generate-contracts.mjs --check` — no drift
- `ruff format --check` / `ruff check` on the touched Python files — clean

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-11-07 14:20:07 +01:00
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