Commit Graph

40 Commits

Author SHA1 Message Date
Anthony
4b1bcba8a9 fix(voice): stop speaking asterisks and drop the play-aloud auto-play prompt
Unwrap bold, italic, and strike before TTS so leftover asterisks are not spoken. Play aloud only plays that reply; auto-play stays a Settings preference. Failed synthesis shows an error toast, and stop cancels an in-flight request.
2026-09-22 19:41:20 -07:00
Bingxi Zhao (Frank)
ee24f44fa7 fix(ui): unify accessible tooltips (#1526) 2026-09-21 14:51:29 +08:00
Bingxi Zhao (Frank)
9083d5fe3c fix(attachments): surface PDF processing stages (#1523) 2026-09-21 14:50:37 +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
Bingxi Zhao (Frank)
c547a5a31c fix: resolve verified learning, ingestion and delivery regressions
Bind mastery drafts before their opening turn and preserve stored session modes.
Track chat duration from submission through terminal completion. Run async reading
extensions on their event loop and allow retries after cancellable timeouts.
Allow first uploads into empty LlamaIndex knowledge bases, preserve Telegram
thread routing, parse embedding Retry-After dates, and enforce robots rules and
host pacing during documentation crawls, including redirects.

Fixes #1461
Fixes #1458
Fixes #1451
Fixes #1448
Fixes #1392
Fixes #1429
Refs #1435, #1412

Reuses contributions from PRs #1462, #1452 and #1403.

Co-authored-by: sjagadee <srini.jagadeesh@gmail.com>
Co-authored-by: AoHanBei <dongaohan21@gmail.com>
Co-authored-by: Gao-Chenkai <DevChenkai@outlook.com>
2026-09-15 20:06:57 +08:00
Bingxi Zhao (Frank)
42d793839b Merge branch 'dev' into worktree-chat-engine-interleaved 2026-09-15 13:25:06 +08:00
Gao Chenkai
3192757d45 fix: handle DeepSeek reasoning budget exhaustion (#1331)
* fix: handle DeepSeek reasoning budget exhaustion

* style: satisfy ruff format, the one thing CI was red on

`ruff format --check` on agent_loop.py, the Responses parser and the test
file that came with them. No behaviour change.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

---------

Co-authored-by: Bingxi Zhao (Frank) <13051345080@163.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-09-14 01:43:40 +08:00
Bingxi Zhao (Frank)
04fc825660 style(chat): give the working-out one content edge instead of four
A trace row carries its own mark column, so its text sat 27px right of the
prose above it. Read down the column, every other line stepped sideways —
and inside 42px there were four left edges: the rule, the prose, the dots,
the row text. Even spacing could not make that look composed.

The rows are pulled back by exactly that gutter now, and the column's padding
widened to hold it. Two edges remain: one the prose and the steps share, and
the dots hanging in the margin beside it, which is what a bullet gutter is
for. Measured after: a single content edge at 272, dots at 252, the rule at
244, and no horizontal overflow at 375px.

The vertical rhythm is left alone. It reads as two rhythms because it is two:
~11px between steps in a run and ~21px between a run and the prose around it,
which is the ordinary relationship between a line break and a paragraph one.
2026-09-12 00:08:37 +08:00
Bingxi Zhao (Frank)
34d7be0827 fix(chat): keep a just-finished turn's reasoning where the reader left it
Opening the trace on a turn that had only just finished showed its tool rows
with every line of reasoning missing, hitched, and then repainted with them
all present. The duration also read a second longer open than closed.

One cause. A turn settles by trading its events for a compact preview, and
the preview drops ``thinking`` — so the rows the reader had been watching a
second earlier were no longer in memory and had to come back from the server.
The fetch then replaced the message's trace metadata with the page's own,
which carries no span, leaving the duration to be re-derived from whatever
events had arrived: past a rounding boundary, 11s became 12s.

So the compaction is deferred by one turn. The newest turn keeps its events —
the one the reader is most likely to open, for the cost of one turn's events —
and the turn before it is compacted in its place, which is what bounds the
memory. Opening it now costs nothing: no fetch, no repaint, no missing rows.

The span is carried across the fetch as well, so a turn reloaded from the
server keeps one duration too, rather than changing it on the way open.
2026-09-11 22:37:49 +08:00
Bingxi Zhao (Frank)
edb779c1b0 perf(chat): stop a streaming turn re-deriving what has not changed
Two pieces of work ran on every streamed delta without producing a pixel.

The first is the working-out. ``messageSegments`` is rebuilt from scratch
whenever content arrives, so the trace — which stops changing the moment a
turn starts writing its answer — handed React a brand-new element tree on
every frame of that answer, and React cannot skip a subtree whose elements it
has never seen. Profiled over one turn: 2905 renders of the process, against
2 milliseconds total for the answer's own markdown beside it.

It now sits behind a memo keyed on what it holds rather than on the props it
is given, and a turn that has started writing its answer marks the process
above it settled, so even the event counts stop mattering. Measured the same
way afterwards: 346 renders, every remaining one during the thinking phase
where the trace really is still moving.

The second is the reveal rate. A markdown consumer re-parses its whole
document on every render, so a turn costs reveals × length — and revealing
per delta made that quadratic in the answer's own length, which is the shape
of "it streams fine at first and gets choppier the longer it runs". The rate
cap has to be in time rather than characters, because a model sending three
characters at a time sets the pace and there is nothing to reveal ahead of
it. A page-length reply is untouched; a 5KB one reveals at 20fps.

The list also handed every row a fresh onTraceToggle closure, which defeated
the memo on AssistantMessage outright: every message in the conversation
re-rendered on every delta of the turn at the bottom.
2026-09-11 22:00:53 +08:00
Bingxi Zhao (Frank)
9f3990463f fix(chat): let the closing answer stream where it will stay
Where a turn's prose was placed was gated on the same "this round was the
terminal one" signal that decides whether to fold the working-out away. So
the closing answer streamed INSIDE the collapsible process and hopped out of
it once the round finished.

That gate could never have been satisfied in time. A round only reveals
whether it called tools after its prose is complete, so for the whole length
of the answer the reader watched it arrive dressed as reasoning, in a region
whose whole promise is that it holds things not worth reading.

Placement is structural now — whatever is being written is the answer — and
only the fold still waits for the terminal round. That inverts which case
pays: commentary is demoted into the process when its round turns out to
have called a tool, costing one 14px slide at the moment the tool row
appears under it, and the text the reader came for never moves at all.
2026-09-11 18:12:27 +08:00
Bingxi Zhao (Frank)
3f706e9844 refactor(chat): one disclosure vocabulary for the folded working-out
The two-layer turn gave the activity header a second job — it is now the
control that puts a whole turn's working-out away — but the header had been
written for a line that is read, not clicked, and deliberately showed no
affordance at all. Once a settled turn folds everything behind it, that
leaves nothing saying the reasoning still exists: it reads as discarded.

So the header ends in a caret whenever it is expandable, at the weight of
the metadata beside it, and the run-level fold below a card echoes the same
shape (label first, caret after) instead of leading with its own chevron.

Both folds now share one primitive rather than repeating the grid-rows
trick, and move on the sidebar disclosure's curve, so a header and the
content hanging from it settle on the same beat.
2026-09-11 17:56:08 +08:00
Bingxi Zhao (Frank)
a37cb93947 feat(chat): fold a turn's working-out away once it reaches the answer
Interleaving the commentary with the steps it introduced made a turn readable
while it ran, and left the finished message carrying its whole working-out
above the answer. Watching the work happen and re-reading it afterwards are
different needs, and only the first is served by keeping it in the flow.

So the two become layers. The working-out streams open, exactly as before,
then folds itself into the activity header the moment a round completes as the
turn's terminal one. The header already times the turn and already is a
disclosure, so it now says what it folded — "2 tool calls · 2 notes" — and one
click brings it all back. Cards are not folded: a question the reader was
asked is part of the exchange, not working-out, so it keeps its place and
breaks the process into runs around itself.

The rhythm inside that layer is fixed too. Markdown carries a bottom margin
and the trace rows carried only a top one, so a row sat 24px under the
sentence that introduced it and flush against the one that followed — reading
as a heading for the next paragraph rather than the step between them. One gap
now governs the column, which hangs from a guide line so it reads as one unit.

A call the reader already sees as a card no longer draws a row of its own: the
card is that call's presentation, and the row landed below the very question
it had asked.
2026-09-11 17:19:02 +08:00
Bingxi Zhao (Frank)
541b7f4f16 feat(chat): let a turn read as a running account instead of an answer with hidden working
Every round already streamed its text to the reader. The loop then took it
back: a round that called tools was marked narration, and the client moved
that prose out of the answer and into a collapsed block pinned to the top of
the message. The reader watched a sentence appear and vanish, and what was
left was an answer with no account of how it was reached.

That behaviour came from one field doing two jobs. ``call_role`` said both
where the turn was and whether the text counted, so "more work follows" and
"hide this" could not be told apart — and three separate exceptions had grown
to say "actually, show this one" for DSML, truncation and mastery.

Split the two facts. ``call_role`` keeps the phase. A new ``answer_visible``
carries visibility, true for every ordinary round, false only where a
capability's finish guard retracts a round it rejected. The three exceptions
disappear with the default they were fighting.

The client then lays the message out in the order it was written: the sentence
that introduced a step, the step's own row beneath it, what the next round
said below that. A settled turn is restored from an event preview that carries
no text, so tool calls now record how much of the answer had been written when
they ran, and the stored body is laid back out around them.

The prompt asks for the commentary this depends on, and says the closing
answer should not replay it.
2026-09-11 16:49:40 +08:00
evan188199-tech
0f8759f730 feat(watching): browse connected Invidious accounts (#1241) 2026-09-11 04:39:34 +08:00
Bingxi Zhao (Frank)
82621bd2f6 follow-up to #1308: one command-id generator, and not from Math.random
`crypto.getRandomValues` is not gated on a secure context — only
`randomUUID` is — so it is the right fallback on a plain-HTTP deployment,
and the `Math.random` tail is left only for a runtime with no Web Crypto.

The bare `globalThis.crypto.randomUUID()` this fixes had a twin at
`contracts/parse/turn-command.ts`, which throws in exactly the same
deployment. Both now call one exported `newCommandId`, living beside the
`command_id` field it fills rather than in the transport that happened to
notice first.

(cherry picked from commit 70333c900034d383500ca92e294b23445394068f)
2026-09-10 23:55:18 +08:00
LuLi
a599445b02 fix(web): fall back when crypto.randomUUID is unavailable for command ids (#1308)
Co-authored-by: Healer-star-code <Healer-star-code@users.noreply.github.com>
2026-09-10 23:45:21 +08:00
Bingxi Zhao (Frank)
771174f494 fix(web): re-send a refused answer instead of discarding it (#1273)
When a question's turn is gone, `submit_user_reply` is refused — correctly;
the backend has no waiter left. What the three composers did with that
refusal is the bug: they raised "This question is no longer active, so your
answer could not be sent. Send a new message to continue." and returned.

The composer had already cleared the box, so the return discarded what the
user had typed. And the advice was impossible to follow: every subsequent
message hit the same branch, because the predicate that routes into it reads
only the persisted card, which nothing ever retires. The one instruction the
error gave was the one thing it was preventing.

So a refused reply now falls through to `sendMessage` with the same content.
The card is one way to answer, never the only one, and the conversation
cannot trap the user — whichever of the several ways in to a dead turn they
came by (a backend restart, a Stop, a replay race).

The message says what actually happened rather than reporting a failure:
the text was delivered, just not to the question. `REPLY_NOT_DELIVERED`
stays for the card banners, where it remains true — a card's own Submit has
no composer to fall through to.

The regression test pins the refusal path specifically: it fails against the
previous `return`, which is the shape that stranded the reporter.

This does not remove the need to retire a dead card server-side (no
`ask_user_resolved` counterpart is ever emitted when a turn dies) — that is
the deeper half and is left as follow-up.
2026-09-08 00:26:00 +08:00
Bingxi Zhao (Frank)
895d2cce25 fix(web): stop the copy button reporting a success that never happened
The button inferred success from its handler's promise *resolving*, and the
handler it was given could not fail: `copyAssistantMessage` awaited
`navigator.clipboard.writeText` inside a try/catch that logged and swallowed.
So the only failure signal was destroyed one frame before the only code that
could have used it — and every clipboard failure rendered 已复制 with a
checkmark. Because the label is also the `aria-label` on an `aria-live`
element, the false success was announced to screen readers.

The failure is not exotic. `launcher.py` binds the web app to 0.0.0.0 while
printing a localhost URL, so opening the same instance from another machine
on the LAN is an ordinary way to run DeepTutor — and on that plain-http
origin `navigator.clipboard` does not exist, so reading `.writeText` throws
synchronously. `FilePreviewDrawer` already carried a comment naming this
exact cause; the handling was local instead of shared.

So: one `copyText` helper that rejects when the text did not reach the
clipboard, with a selection-based fallback for insecure origins (probed
before any await, since `execCommand` needs the click's user activation);
`CopyActionButton` narrowed to a `Promise<void>` handler and given a real
failure state, so the contract cannot be reintroduced by the next consumer;
and the three consumers plus the two other optimistic sites moved onto it.

`Promise.resolve().then(() => onCopy(...))` replaces
`Promise.resolve(onCopy(...))` because the latter runs the handler outside
the chain, which is where the synchronous TypeError was escaping.

Also adds the `attachments` and `references` locale keys. Both call sites
pass a lowercase noun for inline reading, neither key existed, and i18next is
configured to return a missing key verbatim — which is why a Chinese UI
rendered "5 attachments" in English next to this very button.
2026-09-08 00:22:08 +08:00
XZH
6c6ef741d9 fix(chat): preserve pending ask_user turns 2026-09-06 22:15:33 -07: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
f9721b61c4 perf(session): lazily load turn event traces (#1191)
* perf(session): lazily load turn event traces

* fix(session): bound trace previews at the storage layer

---------

Co-authored-by: XZH <cto@xzh.ai>
Co-authored-by: Bingxi Zhao (Frank) <13051345080@163.com>
2026-09-03 15:46:04 +08:00
Boooobby
4069f900cc fix: preserve raw content during Chinese Markdown streaming (#1178)
* fix: normalize Chinese Markdown emphasis boundaries

* fix: preserve raw content during markdown streaming

* fix: sort turn executor imports
2026-09-03 15:30:26 +08:00
Bingxi Zhao (Frank)
93df3d48b7 release: v1.6.4
Ship lighter isolated runtimes, richer Books and Mastery flows,
Reading/session polish, and explicit model API capabilities.

Release notes: assets/releases/ver1-6-4.md
2026-09-03 01:38:54 +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)
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)
b5cdb10f2e refactor(web): consume the canonical capability catalog 2026-09-01 19:22:36 +08:00
Bingxi Zhao (Frank)
cd195e977a refactor(web): split knowledge clients and engine forms 2026-09-01 18:55:55 +08:00
Bingxi Zhao (Frank)
f63e29c7c5 refactor(web): split chat message and trace presentation 2026-09-01 18:23:31 +08:00
Bingxi Zhao (Frank)
68bb0d108d feat(web): unify turn lifecycle feedback 2026-09-01 18:13:58 +08:00
Bingxi Zhao (Frank)
d5836d7e1d fix(web): route chat workspace through compatibility facade 2026-09-01 18:08:02 +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)
4910fcd005 refactor(web): reduce chat route to feature composition 2026-09-01 17:52:20 +08:00
Bingxi Zhao (Frank)
8ecc5f856d refactor(web): type start-turn request assembly 2026-09-01 17:49:51 +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)
422ac501e5 refactor(web): add selector-based chat store 2026-09-01 17:41:11 +08:00
Bingxi Zhao (Frank)
1115cdbb92 feat(web): add multi-worker turn runtime client 2026-09-01 17:34:39 +08:00
Bingxi Zhao (Frank)
0282d85bd6 fix(web): make turn state server authoritative 2026-09-01 17:30:39 +08:00