Commit Graph

490 Commits

Author SHA1 Message Date
Bingxi Zhao
290119df5e Merge pull request #1049 from ZQR1101/fix/switch-branch-optimistic-id 2026-08-29 11:53:57 +08:00
Bingxi Zhao
92a2fcf077 Merge pull request #1052 from evan188199-tech/codex/fix/book-language-options 2026-08-29 11:51:18 +08:00
Bingxi Zhao
acddbb327e Merge pull request #1057 from dongyu-will/codex/deep-question-validation 2026-08-29 11:49: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
Bingxi Zhao
edf7b5ec2f Merge pull request #1027 from ZQR1101/fix/delete-turn-optimistic-id 2026-08-29 11:28:58 +08:00
XZH
6d6c5b23f5 fix(chat): select newly sent branch
Fixes HKUDS/DeepTutor#739
2026-08-28 11:41:45 -07:00
weidongyu
e0664b21bb fix(question): validate topic before generation 2026-08-28 17:09:59 +08:00
XZH
c9920a237c feat(book): infer requested language 2026-08-27 20:27:37 -07:00
ZQR1101
7b3c9c0cff fix(web): skip persisting optimistic branch selections
switchBranch wrote negative client ids into selected_branches even though reload hydration drops them (n > 0 only). Keep local UI updates but only POST persisted ids.
2026-08-28 11:25:01 +08:00
XZH
7686e8f1f8 fix(partners): coalesce streaming draft updates 2026-08-27 08:18:41 -07:00
Bingxi Zhao (Frank)
bd9f6a7625 release: v1.6.0 — connected learning workspaces
Release notes: assets/releases/ver1-6-0.md

Ship source-faithful reading, Courses and Little Tutor, Ask Questions,
bounded web-source sync, and shared Books with private reader state.
2026-08-27 22:03:09 +08:00
ZQR1101
a8e5e91f88 fix(web): resolve optimistic ids before deleteTurn
editMessage already uses resolvePersistedMessage after #753, but deleteTurn still re-read stateRef after loadSession and could miss the persisted id on the first attempt. Route delete through the same refresh-snapshot helper.
2026-08-27 12:06:23 +08:00
Bingxi Zhao
8e281c6e27 Merge pull request #996 from zhou2030109-glitch/codex/selection-tutor-learning-spaces
feat: add selection tutor and course workspaces
2026-08-26 02:41:02 +08:00
XZH
32f82dcfb8 feat(knowledge): expose bounded web sources in detail view 2026-08-26 02:26:58 +08:00
XZH
0d8b734a76 feat(knowledge): add web source sync 2026-08-26 02:26:58 +08:00
Bingxi Zhao (Frank)
69b472b109 fix(courses): enforce organization and tutor grounding integrity 2026-08-26 02:25:23 +08:00
diffaudit-review
cdbcacace4 fix: ground selection tutor in source message
Short selections such as rc carried only the raw token and an opaque parent session id. Capture the containing message id, resolve it from the parent session, and provide both the source message and exact selection to the tutor prompt.
2026-08-26 02:25:23 +08:00
diffaudit-review
3709c9e854 feat: add selection tutor and course workspaces 2026-08-26 02:25:23 +08:00
Bingxi Zhao (Frank)
11c0a1ed68 fix(chat): preserve ask-user protocol across fallbacks and history 2026-08-26 02:08:46 +08:00
SeleiXi
4c9df02a97 feat: add context-aware ask questions mode 2026-08-26 02:07:39 +08:00
Bingxi Zhao
d86763af8a Merge pull request #975 from evan188199-tech/codex/fix-mastery-unicode-display
fix(chat): decode dense non-ASCII unicode escapes for display
2026-08-26 01:39:40 +08:00
Bingxi Zhao (Frank)
20f95999c3 fix(chat): strip decoded invisible unicode controls 2026-08-26 01:30:03 +08:00
XZH
40671bfa50 fix(chat): decode dense non-ASCII unicode escapes for display 2026-08-26 01:30:03 +08:00
Bingxi Zhao (Frank)
37f56de042 fix(reading): isolate malformed extension catalogs 2026-08-26 01:27:49 +08:00
Bingxi Zhao (Frank)
28c0f7d295 fix(reading): preserve annotation offsets around heading anchors 2026-08-26 01:24:22 +08:00
Bingxi Zhao (Frank)
2a8617008f fix(reading): keep heading anchors through highlights 2026-08-26 01:24:22 +08:00
XZH
0e7ccc3ae3 fix(reading): separate outline views and stabilize heading jumps 2026-08-26 01:24:22 +08:00
XZH
1150fcecce feat(reading): add persistent document outline 2026-08-26 01:24:22 +08:00
Bingxi Zhao
6a6dc04cca Merge pull request #970 from evan188199-tech/codex/upstream-reading-extensions
feat(reading): add safe extension protocol and empty toolbar slot
2026-08-26 01:21:44 +08:00
Bingxi Zhao (Frank)
1f6fe858f1 fix(reading): isolate timed-out extension workers 2026-08-26 01:04:12 +08:00
XZH
27700d4a48 feat(reading): add safe extension protocol 2026-08-26 01:00:05 +08:00
Bingxi Zhao (Frank)
51731719fb fix(reading): scope and fully reset display preferences 2026-08-26 00:59:24 +08:00
XZH
f870d43cfa feat(reading): add adjustable text display preferences 2026-08-26 00:59:09 +08:00
Bingxi Zhao (Frank)
4cf053257c fix(reading): resolve reflowed text selectors consistently 2026-08-26 00:53:32 +08:00
XZH
bb1b3569c8 test(reading): audit W3C annotation rendering 2026-08-26 00:49:58 +08:00
XZH
6ebde8693b feat(reading): render reflowing annotations with Recogito 2026-08-26 00:49:58 +08:00
XZH
e758af8f48 feat(reading): render EPUBs faithfully in ReaderPane 2026-08-26 00:31:24 +08:00
XZH
c59b9547d7 fix(book): read long chapters sequentially before turning pages 2026-08-24 19:39:23 -07:00
Bingxi Zhao (Frank)
c600a507a4 fix(tests): stop the partner suite writing to the real account store
`identity` binds `AUTH_DIR = SYSTEM_ROOT / "auth"` at import, so the
partners fixture's `setattr(paths, "SYSTEM_ROOT", tmp)` never reached it:
`save_user` wrote into the developer's own `data/system/auth/users.json`
and read it back. The suite had already deposited an `alice` account
there.

That also made `test_a_linked_sender_gets_their_own_private_history`
depend on who else happened to have an account. The first account in a
store is force-promoted to admin whatever role is asked for, and an
admin's scope *is* the shared pool — so on an empty store alice became
admin and "her private history" and "the shared pool" resolved to one
directory. It passed on a machine with existing accounts and on a full
run, and failed alone and on all four Python versions in CI (v1.5.17's
release commit is red for exactly this).

The fixture now redirects identity's file constants too, and `alice` is
saved after an admin so she is guaranteed non-admin — asserted, so the
precondition cannot rot silently. Product code is unaffected: the
behaviour under test was always correct.

Also collapses the three copies of the api_key reduction into one.
`_primary_api_key` (provider_runtime) is deleted and
`LLMConfig.get_api_key` delegates, both to `keypool.primary_api_key`,
which now treats an empty key as absent in either spelling so its list
and scalar branches agree. Equivalence checked across every configured
shape: "", None, [], [""], ["", "k"], "k", ["k"], ["k1", "k2"].

pytest 5284 passed (was 5276), pre-commit clean, ruff check + format
clean at CI's pinned 0.16.0.
2026-08-25 10:20:26 +08:00
Bingxi Zhao (Frank)
bd80a4d28a release: v1.5.17
Partners stop being a deployment-wide admin resource and become
per-user: three nested rights (manage / use / neither) replace the
blanket admin gate on the router, each member can build and own their
own, and every person's conversations with a partner stay private to
their account. Grants keep working and now offer only admin-managed
partners. Channel runtime state moves from one directory per channel to
one per partner — copied, not moved, and only when its owner is
unambiguous — so two partners can finally run the same channel.

Around that: a knowledge base can track GitHub repositories and re-sync
their Markdown (#903); Antigravity CLI joins My Agents now that Gemini
CLI is retired (#828); personal WeChat signs in from a QR code drawn in
the browser instead of the server log (#951); a chat account can be
linked to a DeepTutor account with /link; containers re-apply the extras
they declare instead of losing them at compose down (#762); and
`deeptutor doctor` answers whether a workspace is ready to run (#959).

Reliability, largely from community PRs: embeddings survive a
rate-limited provider through key rotation, a retry budget and a global
throttle (#962); MinerU parsing and code execution work on Windows
(#844, #964); indexing fails bounded instead of hanging (#946); MinerU
page-layout blocks stop being indexed as content (#949); voice uploads
carry a MIME the transcription API accepts (#945); and reasoning effort
can be overridden per conversation (#641).

Release plumbing: notes in assets/releases/ver1-5-17.md, v1.5.13
archived, __version__ 1.5.17, README Releases row and all eleven
translations synced.

Two defects found by the release gate and fixed here:

- Six partner routes — the four channel-onboarding endpoints and both
  WeChat QR endpoints — kept the _auth-only mount they had inherited
  from the blanket admin gate, so any signed-in account could start a
  QR login for someone else's partner and write a bot token into its
  channel config. All six now declare _MANAGEABLE, and a sweep test
  asserts no {partner_id} route is left ungated.
- A configured api_key became `str | list[str]` when key rotation
  landed, but ten call sites pass it somewhere that takes one key; a
  list would have rendered into an Authorization header verbatim.
  keypool.primary_api_key reduces at each boundary.

Gates: pre-commit (all 15 hooks), ruff check + format, pytest
5276 passed, web 605 node tests, docs build.
2026-08-25 02:24:35 +08:00
evan188199-tech
50f8ccbaa4 feat: split knowledge sync - add GitHub source sync (#903)
* feat(knowledge): add GitHub source sync

* fix(github-sync): contain downloaded paths inside the KB raw dir

Destinations were built as `raw_dir / rel` where `rel` is derived from the
GitHub tree/compare response — remote input. Two shapes escaped: a `..`
segment, and an absolute path, which is the quieter one because
`Path("/kb") / "/etc/x"` is `/etc/x`, silently discarding the base. The only
filters in the way checked the file extension and the glob, so a matching
path would have been written — and, on the removal branch, deleted — outside
the knowledge base.

git rejects both shapes in tree entries today, so this is defence in depth
rather than a live exploit; a downloader still should not delegate to the
remote the question of where it writes. One `_contained_dest` seam now guards
the full-sync write, the incremental write, and the removal, and logs what it
refused.

---------

Co-authored-by: XZH <cto@xzh.ai>
Co-authored-by: Frank <bingxizhao@novix.science>
2026-08-24 16:55:47 +08:00
ZQR1101
7edddbec61 fix(web): pin chat to late-mounted quiz cards (#960)
* fix(web): pin chat to late-mounted quiz cards

QuizViewer loads after the 4s post-stream scroll window, so mastery quiz cards stay below the fold until the user scrolls. Watch [data-chat-grow] for 12s without re-pinning unrelated details expands.

Related to #955

* fix(web): extend the existing post-stream window for late viewers

The post-stream effect already existed for exactly this case — its comment
names QuizViewer — so a second, parallel MutationObserver with its own 12s
window meant two observers racing for the same pin, each unaware of the
other's deadline.

Fold the extension into that one effect: the window starts at 4s and only a
*newly appearing* ``[data-chat-grow]`` node pushes it out to 12s. Gating on
appearance rather than presence matters — presence alone is satisfied
permanently by any quiz card from an earlier turn, which would have re-pinned
the user on every later DOM mutation, the precise mis-classification the
short window exists to avoid. The teardown timer follows the current
deadline, so a turn with no late viewer stops observing at 4s as before.

---------

Co-authored-by: ZQR1101 <278034003+ZQR1101@users.noreply.github.com>
Co-authored-by: Frank <bingxizhao@novix.science>
2026-08-24 16:52:00 +08:00
ZQR1101
ac25a5c868 fix(voice): strip MediaRecorder codec params from STT uploads (#948)
* fix(voice): strip MediaRecorder codec params from STT uploads

Chrome sends audio/webm;codecs=opus; OpenAI-compatible transcription APIs reject that as an unknown format.

Fixes #945

* refactor(voice): normalize the STT MIME once, at the wire boundary

The codec-parameter strip was applied at four layers: the recorder hook, the
route, the `transcribe_audio` facade, and `_post_multipart`. Only the last of
those decides what actually goes on the wire, and `openai_compat` is the sole
registered STT adapter, so the two middle copies were pure duplication —
and they made the route's contract ambiguous about who owns the value.

Keep the client-side strip (it sets the Blob type, which is what the browser
puts in the multipart part) and the adapter strip; drop the route and facade
copies along with the now-unused facade re-export. The adapter-level test
already pins the wire contract; the route test now asserts what the route
actually promises — verbatim forwarding.

---------

Co-authored-by: ZQR1101 <278034003+ZQR1101@users.noreply.github.com>
Co-authored-by: Frank <bingxizhao@novix.science>
2026-08-24 16:51:49 +08:00
evan188199-tech
ec4ee2356a feat(partners): add QR channel onboarding (#952)
Co-authored-by: XZH <cto@xzh.ai>
2026-08-24 16:34:29 +08:00
Bingxi Zhao (Frank)
8515dfdbe6 release: v1.5.16
Release notes: assets/releases/ver1-5-16.md

Content bundled into this commit:

* Release notes for v1.5.16 and the version bump to 1.5.16.
* README: the Releases row for v1.5.16, and MarginNote 4 added to the two
  places that enumerate the retrieval engines (Key Features, Knowledge
  Center) — the engine list was the only prose the release made stale.
* All 11 translated READMEs patched for that same engine-list change.
* Book: make the reader's row a flex column. v1.5.15 added the capture
  inbox as a second child without it, so `PageReader`'s `h-full`
  collapsed to `auto` — the body stopped scrolling and the page-turn
  footer was clipped away.
* progress_tracker: annotate the progress dict as `dict[str, object]`.
  The i18n work added a dict-valued `message_params` to a mapping mypy
  had inferred as `dict[str, int | str]`.
* prettier on the two MarginNote 4 frontend files it had not yet seen.

Gates: pre-commit (15/15), `ruff check .` clean, pytest 5007 passed /
22 skipped, `npm run test:node` 586/586, and the docs site builds.
2026-08-22 01:36:30 +08:00
Bingxi Zhao (Frank)
323c4d6e7a feat(knowledge): surface MarginNote 4 in the Knowledge Center grid
The connected source only existed inside the create modal's link list, so
the Knowledge Center home offered Obsidian as something you can connect
and said nothing about MarginNote. Anyone who did not already know to
open the modal and switch to "Link existing" had no way to find it.

Give it the card Obsidian has, in the same place and with the same
behaviour: the connected-library count when there is one, and a click
that opens the unified create flow pre-set to this source.
2026-08-22 00:08:30 +08:00
Bingxi Zhao (Frank)
2af5ba7abf feat(knowledge): give MarginNote 4 libraries a frontend
The connected KB type landed with no way to create one and no way to
pair the add-on that fills it, so the feature was unreachable from the
app.

Connecting: a MarginNote card in the create modal's link sources. It
asks for a name and nothing else — `db_path` is deliberately not sent, so
the store's location keeps one rule and pairing, the add-on's syncs and
the capability binding cannot disagree.

Feeding it: a Devices tab on the library, with the paired-device list,
revoke, and the one-time token shown once at pairing (the server keeps
only a hash). Every call names its library through `X-MN4-KB`, which is
what makes the token findable by the syncs that present it.

The detail view's sections are now derived rather than fixed: a library
owns no raw files and builds no index, so Files / Add documents / Index
versions rendered empty against it, the header read "llamaindex ·
Default embedding" for a pipeline it never runs, Settings offered an
on-disk path that does not exist, and Retry indexing offered to re-run
nothing. Each now reports what the library actually has.
2026-08-21 22:51:05 +08:00
Bingxi Zhao (Frank)
10297532b5 feat(knowledge): make indexing progress lines translatable
Every progress line the knowledge log box shows was a hardcoded English
string — 22 producers across the initializer, the document adder and the
router, rendered verbatim in the UI. #933 added one more ("Describing
images: m/n"), which is what surfaced the class.

Indexing runs detached from any request, so the backend has no viewer
language and the language of record lives in the browser anyway. So the
wire now carries the English `{{name}}` template plus its values, and the
frontend renders it with `t()` where the language is actually known.
`ProgressTracker.update` fills `message` from that same template, so
every consumer without i18n of its own — logs, the persisted snapshot,
the CLI — reads what it read before, and no call site spells the string
twice.

Untouched producers keep working: `progressMessage()` falls back to the
rendered `message` when no template is named.
2026-08-21 16:58:42 +08:00
LamXwah
e7dead14f9 fix(chat): prune deleted knowledge base references from sessions (#936)
* fix(chat): prune deleted knowledge base references from sessions

* style(chat): drop the unrelated reformat from the KB-pruning change

ChatMessages.tsx arrived with ~50 lines of prettier output that the fix
does not need: `.map()` arrow bodies unwrapped for bookReferences,
notebookReferences, historyReferences and memoryReferences, plus a union
type joined onto one line. `dev` does not follow prettier for this file
(`prettier --check` flags it on `dev` too), and CI gates neither prettier
nor tsc for web, so the churn would have landed silently.

Restore those hunks and keep only what threads `availableKbNames`
through: the two prop declarations, the two destructures, the pass-down,
and the `.filter()` in front of the knowledge-base context items. The
remaining reindent inside that `.map()` is intrinsic to inserting the
filter ahead of it.

---------

Co-authored-by: Bingxi Zhao (Frank) <13051345080@163.com>
2026-08-21 15:58:26 +08:00