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.
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.
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#1461Fixes#1458Fixes#1451Fixes#1448Fixes#1392Fixes#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>
* 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>
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.
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.
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.
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.
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.
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.
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.
`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)
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.
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.
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
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
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