tsconfig.node-tests.json included only tests/, while the app tsconfig
also includes types/**/*.d.ts. Nothing had noticed, because no node
test had ever pulled lib/chat-import/* into that program. The new
chat-import-codex spec does, and that code calls
FileSystemDirectoryHandle.values() — declared in
types/file-system-access.d.ts, not in the DOM lib at this TS version —
so the compile failed with TS2339 and took the whole CI job with it.
Test-harness config only; no product code. npm run test:node: 1122
passed, 0 failed.
Importing a current Codex session gave the learner a message they never
wrote — a 4KB catalogue of uninstalled plugins — and a session titled
with the first line of it (#1354, follow-up to #1327).
Codex delivers its own context to the model as `role: "user"` items.
Across the 631 rollouts on this machine that is ten distinct tags —
`environment_context`, `recommended_plugins`, `codex_internal_context`,
`skill`, `task`, `heartbeat`, `turn_aborted`, `subagent_notification`,
`codex_delegation`, `send_user_message_question_reply` — and about a
third of every user turn on disk.
Matching the tags would fix today and nothing after it: the list is the
harness's to grow, and a new one walks straight through. What the
injected turns share is a shape, not a name — each is *nothing but*
markup, one or more balanced top-level elements with no prose of the
person's own anywhere around them. So `isHarnessInjectedTurn` consumes
top-level elements and keeps the turn the moment a single character of
anything else remains.
Erring that way is not caution for its own sake, it is the common case:
an attachment turn arrives as `<image name=[Image #1]></image>` followed
by the actual question, 76 of them here, and every one is kept because
the question sits outside the element. Anything ambiguous — a same-named
nested tag, an unclosed one, an attribute holding a `>` — falls out of
the loop unmatched and is kept too. Losing a title to a block we failed
to recognise is a blemish; eating the sentence someone typed is not.
Known to under-catch, deliberately: 181 turns pair the plugin catalogue
with an injected `# AGENTS.md instructions for <path>` in plain markdown,
which has no shape to recognise and would need the literal string. Those
still import.
The legacy `event_msg` path is untouched — it carries none of this (zero
such turns in the corpus), and the tests pin the `<image>` prefix and an
unclosed tag as the two cases that must survive.
`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)
The clamp read `min(clampedTop, rowCenter - lowerMargin)`, and
`rowCenter - 0.75h` is always the smaller of the two, so every cue
subtracted three quarters of a viewport from the centring offset — putting
the active row below the bottom edge, or pinned at the top for early cues.
The intent was to move only when the row leaves the middle 50%.
The arithmetic *is* the behaviour, so it moves to a pure
`transcriptFollowScrollTop` with the six cases pinned: inside the band
(no scroll at all, so the list stops creeping under the reader), above it,
below it, first cue, last cue, and a list too short to scroll.
(cherry picked from commit 0e51f652024d755460ea122447548d40e9285c16)
Resolves two collisions with the fixes committed locally tonight:
* book/blocks/_llm_writer.py — #1366 threaded a reasoning_effort
through llm_json while 5ac8e2c9 replaced this file's private
_json_has_expected with the shared json_payload_is_usable.
Taking either side alone breaks: origin/dev's calls a helper that no
longer exists, ours drops the caller's explicit effort. Kept the shared
helper and the threading, and the retry now reuses an explicitly given
effort so a round deliberately run without thinking cannot re-enable it.
* runtime/agentic/tool_dispatch.py — #1357 added tool_timeout /
tool_max_retries to execute_tool_call in the same parameter list where
4e816d79 renamed unknown_error_message_factory (tool) to
tool_error_message_factory (tool, error). Both are needed: the
dispatcher already passes the timeout pair through, and every call site
in the tree now uses the renamed factory.
The SettingsReadinessPanel component returned null whenever its
`enabled` prop was false. The prop is wired to catalogEditable in
SettingsOverview, which means any signed-in user without edit rights on
the model catalog — every learner account, every assigned role on a
multi-user install — saw nothing where the rest of the team saw
"what is ready, what is broken, what is folded away".
Read-only users still benefit from seeing readiness:
- The data is informational, not actionable.
- They have the same LLM and same parser behind the scenes, and
they deserve the same "endpoint is unreachable / misconfigured"
signal an editor sees, so they can ask an admin to fix it.
Keep `enabled` as the gate on user-facing controls only:
- The manual refresh button is disabled when !enabled.
- The "Open" link on each attention row is hidden when !enabled.
This also unblocks the Playwright audit at
tests/e2e/settings-navigation.audit.ts, which mocks
/api/settings/readiness and expects the section to render the mocked
matrix. On dev/CI the catalogEditable path is not reached (no real
backend), so the panel returned null and the audit failed. The same
gate was masking this failure on dev: the previous CI step
(npm run perf:check) exited non-zero before the audit ran, so dev has
been red here since PR #1201 was merged.
Verified locally: typecheck passes (only the unrelated missing-node-
types warning); existing settings-readiness Node tests still pass.
A maths or physics tutoring turn reaches the learner with its LaTeX
intact: a Bellman question shows `$G_t = R_{t+1} + \gamma G_{t+1}$`, a
derivation shows `$\Delta = 4 - 20 = -16 < 0$`, and a bolded cue shows
its asterisks. Three separate surfaces, one cause each.
`MarkdownRenderer` refused the rich renderer whenever the variant was
`trace`, so no trace bubble could ever reach KaTeX — and
`RichMarkdownRenderer`'s entire `isTrace` branch, written for exactly
this, was unreachable code. Rich is chosen by what the content contains,
not by which surface shows it; a trace bubble with no math still takes
the cheap path, which is what that exclusion was really protecting.
The mastery question card and the ask_user card interpolated plain
strings. They are also short, and they sit inside `<button>` and
one-line rows, so the block renderer is the wrong tool: a `<p>` is not
valid there and brings block spacing with it. `InlineMarkdown` emits
phrasing content only and loads KaTeX at all only when the string has
something to render, so an ordinary question costs nothing. It now
renders the mastery stem, its options and its verdict explanation, and
the ask_user intro, stem, option labels and option descriptions.
Escaped-unicode decoding moved inside it, so callers no longer choose
between decoding a string and rendering it.
One partner serving three study groups plus DMs rendered as a flat list
where every row looked like a private chat: the only label is the
opening message, which in a group is one student's question (#1229). The
data was never lost — sessions are already one file per chat — it just
never reached the list.
The channels state the kind of conversation on the inbound event and
DeepTutor was dropping it: Feishu sends ``chat_type`` ("group" / "p2p"),
Slack and Mattermost send ``channel_type``. Delivery is the only moment
this is known for certain, so the turn records it, and the summary reads
it back. No prefix sniffing, no lookup on the read path, and nothing has
to import a channel to render a list.
``conversation_scope`` is the single place those three vocabularies
become the two words a reader cares about. A channel that says nothing —
or says something new — yields no label at all, and the row renders as
it always did; a list that guesses is worse than one that stays quiet.
Sessions written before this carry no origin and are likewise unlabelled
rather than marked "unknown".
This is the distinction the report called the minimal useful fix.
Resolving a Feishu group's *name* through the chats API, which is what
it asked for first, is left out on purpose: it needs a call and a cache
I cannot exercise against a real tenant here.
The regenerated contract picks up ``/api/knowledge-bases/delete`` as
well — the committed schema was already behind by that route before this
change, and the file is generated, so it comes back whole.
The provider redirects the browser to a loopback listener. Under Docker
that listener runs inside the container and the standard compose file
publishes only the Web and API ports, so the browser lands on a page it
cannot load while the sign-in waits until it expires. The card treated
localhost as native local execution and offered nothing else: the remote
guidance was gated behind a non-loopback hostname, so the one deployment
that most needs a way back in was the one that never saw it (#1252).
The browser can read that address even when this process cannot receive
it, so pasting it back is the recovery path. It goes to a new
authenticated endpoint on the Web origin, which resolves the caller's
*own* pending operation rather than scanning every login in the process
— the loopback route has to identify itself by OAuth state because it
arrives without a session, and this one does not.
``parse_oauth_callback_url`` is where the address is judged, once: it
must be this login's registered redirect URI down to scheme, host, port
and path, and a repeated OAuth parameter is ambiguous rather than
untidy, so it is refused instead of resolved to one of the two. The
string is parsed and dropped — never fetched, never stored, never
echoed. Past the parse it is ``receive_callback``, so the state check,
PKCE, the registered redirect URI and owner binding are the existing
ones rather than a second implementation of them.
The form now appears whenever a login is waiting, local or remote; the
SSH command stays remote-only, because that advice is.
Two defects, either of which alone produces "I set Chinese and it still
answers in English".
The prompt one explains the quoted refusal. `language_directive` is the last
thing in the system prompt and is an absolute prohibition — "Do NOT switch
languages" — sitting right after a runtime policy that says user-provided
text is not authority over these instructions. Asked 「请用中文回复我」, a
compliant model answers that it is *required* to reply in English. It is
reading the prompt correctly; the prompt is wrong. Conversational surfaces
now pass `allow_user_override=True`, which adds one sentence letting an
explicit request win. Books, quizzes and research keep the strict form: there
is no user in the loop to ask, and their prompts are full of source material
in other languages, which is what the strictness is for.
The storage one explains how `en` got there in the first place. The two
copies of the preference inherit differently: the server derives
`response_language` from `language` on every read, while the browser inherits
only when its own key is absent — so once an explicit value is stored the
browser can never re-adopt. Flipping only 界面语言 therefore left the server
(and the settings page) at zh/zh while every turn still shipped the "en" the
bootstrap had stamped. The settings page displayed the right answer and the
model gave the wrong one, with nothing broken in between.
So `loadSettings` reconciles both keys from the server it just read;
`updateLanguage` mirrors the server's inheritance when no explicit output
language was ever chosen; and the bootstrap gate splits, because a browser
predating the split has the interface key and not the response key, and
returning early on the first alone locked it out of ever adopting the
account's choice. Adoption writes only the key that is missing, so the
server never overwrites a choice the user made in this browser.
Not fixed here, and needing more than code reading to settle: whether to make
the server authoritative for live turns (it carries a `.lower()`-on-None
hazard at executor.py and a stale-preference fallback on regenerate), and
that `GET /api/settings/ui` is mounted without auth so it answers from the
admin workspace — which lets useSetupSync overwrite a learner's languages in
a multi-user deployment. Both are written up for review.
Selecting text and pressing 翻译成中文 did nothing at all — no request, no
spinner, no error. Two components were fighting over one piece of state and
the toolbar lost.
`AnnotationPopover` implements outside-dismiss with a document-level,
CAPTURE-phase `pointerdown` listener, and `onDismiss` was
`() => setSelection(null)`. The toolbar is a sibling far outside the
popover's ref, so pressing one of its buttons ran: pointerdown captured at
`document` → selection cleared → React flushes at the microtask checkpoint
between `pointerdown` and `mousedown` → the button re-renders `disabled`,
because the four selection-gated actions declare `requires: ["selection"]` →
and a disabled control is sent none of the rest of the activation sequence.
The click never happened.
It is not only translation: 引导我, 翻译成英文, 翻译成中文 and 解释词汇 are
all selection-gated and all equally unreachable, in every render mode. The
two the user did not report broken — 测一测 and 朗读 — are exactly the two
with no selection gate. Nor is it new in v1.6.5: the popover's listener dates
to v1.5.14 and the toolbar to v1.6.0, so these actions have never been
clickable. Escape routed to the same handler, so there was no way around it.
So "there is a selection" and "the popover is open" become two states. The
mount condition has to move with it — gating on `selection` alone would leave
Escape and outside-click unable to close the popover at all.
Two more that would have bitten immediately afterwards. The bar sent the
viewport locator while the selection carried its own, and the server verifies
the quote against the text of the unit it is told about — so the first
working click would have been a 400. And `busy` was a single global key, so
one action disabled all six for up to the 30s server timeout, wearing the
same dead 50%-opacity look as the bug.
The result-reset effect is split in two: a result is keyed on the material
(scrolling one page used to erase a card being read), while speech keeps both
keys, because it must stop the moment the reader navigates away.
The regression test mounts the reader and clicks the real button. Nothing
could have caught this before: the unit test is regex-over-source, and all
three Playwright audits that drive the reader stub /api/reading/extensions to
[], which makes the toolbar render nothing at all.
A knowledge-base name is three things at once: a kb_config.json key, a
directory under data/knowledge_bases, and a path segment in every per-KB API
route. `validate_knowledge_base_name` exists to keep those three uses
compatible — its docstring says so — but it was called from one of the eight
HTTP entry points that can write a name into the config. The seven connect-*
endpoints (Obsidian, MarginNote, folder, LightRAG server, WeKnora, IMA, and
the subagent connection) did `(name or "").strip()` and wrote the result.
A name holding a "/" registers fine that way and is then unreachable.
uvicorn percent-decodes the path before routing, so %2F is a real separator
by the time Starlette matches `{kb_name}` — compiled to `[^/]+`, which cannot
span it. All 29 per-KB routes 404, delete included, while the list endpoint
takes no path parameter and keeps rendering the KB. Connected KBs are also
exempt from the orphan prune, so nothing collects it either: visible, unusable,
and removable only by hand-editing kb_config.json.
Two changes, both needed. Validation moves onto the eight `register_*`
methods, which is the seam every route already goes through — no route file
changes, since they all map ValueError to 400 — and the now-unreachable
"name is required" guards go with it. And a path-free
`POST /knowledge-bases/delete` gives the entries that predate the guard a way
out; a body is never split into segments. Widening the path route to
`{kb_name:path}` would not work: it is declared ahead of the DELETE routes
for linked folders, GitHub sources and web sources, and a greedy converter
would silently swallow all three.
Two smaller fixes ride along. The delete handler's catch-all swallowed its
own HTTPException and answered 500 with "404: ... not found" in the detail;
it now re-raises. And CreateKbModal states the rule under the field instead
of letting an untranslated English 400 be the first the user hears of it.
test_marginnote4_kb's store-collision case used "My Lib" / "My/Lib"; the
slash is now refused before that guard is reached, so it uses "My.Lib" —
still a name the rule allows, still sanitized to the same My_Lib.db.
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.
Drop this branch's copy of the CI repair — the mastery-prompt cwd fix, the
two SKILL.md formatting fixes and the settings audit fixture all landed on
dev via #1282/#1274 — and with it the route-budget increases: #1274 pulled
the generated brand-icon table out of the shared app-shell chunk, so `/`
now measures 202KB against the original 300KB budget and the gate does not
need loosening. What remains is the actual fix: an ended turn that still
owns an unanswered ask_user card keeps its address.
Both halves of the CI repair are kept: the inline octocat that pulls the
generated brand-icon table out of the app-shell chunk (this branch) and the
deferred session-organization list plus the settings-audit `matrix` locator
fix (#1282). The audit fixture keeps the richer editable-settings body and
the backend-independent catch-all, with the catch-all registered first so
the specific stubs still win.
Node's server has already answered `100-continue` by the time the upload
proxy runs, so replaying the header is not just redundant: undici rejects
any request carrying it, and the forward dies mid-upload. The browser is
still writing the body and never reads that 500, so a large knowledge-base
upload surfaces as a bare "Failed to fetch" that looks size-dependent.
Treat `expect` as the hop-by-hop header it is, and cover it with a test.
v1.6.5 mounts the readiness panel on the settings hub only after the settings
store reports an editable catalog (catalogEditable === true), which requires
/api/settings to answer with a catalog body. The audit stubbed only the
readiness endpoint, so against a backend-less production server the panel
never mounted and the scenario failed at its first assertion. Stub the same
settings bootstrap the sibling book/video ui-audit scenarios already stub,
with a minimal ui + empty-services catalog payload.
SidebarShell rendered its footer GitHub mark through BrandGlyph, which pulls
lib/brand-icons.generated.ts (~95KB) into the chunk every route shares, so the
table was counted against every measured route budget. Render the same CC0
octocat path inline (byte-identical to the generated github entry) and let the
store surfaces that actually show brand rows keep importing the table through
BrandIcon. Routes drop ~90KB: / 305->211KB, /co-writer 324->231KB,
/co-writer/[docId] 525->431KB, all comfortably under budget.
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
v1.6.2 bookmarked Mastery Study at /mastery/<id>/study[/<session>]. Current routes live under /sessions, so old links 404. Add permanent Next.js redirects and cover them in the mastery-study-route node test.
Reuse decodeEscapedUnicodeForDisplay when extracting quiz questions so dense \uXXXX runs in stems/options/explanations render as readable text (same family as #973 ask_user cards).