Immersive Reading, self-configuration, and a two-way IMA library.
- Immersive Reading: a new capability that opens a document beside the
thread. New reading engine (PDF pages / slides / page-sized sections),
five reading tools, a deterministic locate pre-pass that grounds the
turn without a second LLM call, /api/v1/reading, and a reader pane with
selection, highlights, notes, and export to an annotated PDF or Markdown.
- Setup capability: inspect the install, apply a setting, install a
parsing engine, or request a credential from a chat turn. New settings
spec table; a candidate value is probed before it is committed, and API
keys never enter the model's context.
- Tencent IMA: pipeline split into transport/envelope/models/sources/
notes/media/inventory, an additive capability with five tools, and
connected libraries that can finally be enumerated (bounded listings
are reported as a lower bound).
- Retrieval: supports_rag_retrieval() replaces is_connected_kb() for the
"can I sweep this?" question, so linked / lightrag_server / ima sources
stop being silently dropped from every book.
- Notebooks: their own console at /notebook, per-notebook locks and atomic
writes, copy / move / export routes, damaged files surfaced instead of
dropped, and renaming a record no longer clears its knowledge-base link.
- Settings persistence: one lock and one atomic replace shared by every
writer of interface.json; the PUT endpoints stop writing the
defaults-merged view back to disk.
Release notes: assets/releases/ver1-5-14.md
Book is the bulk of this one. Compilation outlives the request that
started it, so a bus owned by that request dropped every background event
and "watch your book being written" degraded into a frozen page; the
stream is now owned per book by the process and survives a refresh or a
reconnect. Reading progress is finally recorded — `visited_page_ids` and
`bookmarked_page_ids` had been declared but never written for the life of
the feature — and rolls up into a completion score and weak chapters. A
book can also leave the app now, as one self-contained Markdown document,
with non-ASCII titles surviving the download.
Two scheduling defects that were invisible in production are fixed: the
same page compiled twice concurrently (billed twice, one result
discarded), and a book grinding on through a provider outage until every
chapter was half-generated. The source sweep is bounded and allocated
round-robin rather than spent on the first few knowledge bases, and
retrieval now tells indexed bases from connected pointers, so an Obsidian
vault or a remote IMA library no longer contributes zero while looking
like a source with nothing relevant. Confirming a spine shows a live
per-chapter estimate derived from the Section Architect's own templates.
Also here: three home starter suggestions built from memory recall,
mastery-path handoff moved into one module that changes lease, session
preference, and live turn together, and account-level Tencent IMA
credentials with the per-KB pair still winning.
Notes: assets/releases/ver1-5-13.md
This commit also carries the README prose sync, the eleven translated
READMEs, the release-notes archive sweep, and the version bump. Two gate
fixes ride along: the `Stamped` protocol is declared read-only so the
frozen `EntityStamp` satisfies it, and six GraphRAG adapter tests that
reached a deep `graphrag` import without guarding it now skip like their
four neighbours instead of failing where the extra is not installed.
Changing the model-output language made the whole block vanish. Two causes,
and the second is the more interesting one.
The cache is keyed by language, so a switch correctly invalidates it and the
read returns nothing — but the background regeneration that would refill it was
being swallowed by the probe throttle. That interval exists because page loads
arrive in bursts and the material rarely changes between them; it is exactly
wrong when the caller already knows the cached set is unusable. A read that
finds a cache in another language now forces the probe past the interval. The
in-flight guard still applies, so forcing cannot fan out concurrent calls.
The deeper problem is that "no lines" rendered as "no slot". Every way this can
come up empty — cold cache, failed model call, re-reads that timed out, a
language just switched, no history at all — produced an identical blank space
with no way to act on it. The component now always renders its control once the
first read lands: a spinner with "finding what to explore next" while work is
in flight, and an explicit "suggest what to explore next" button whenever it is
not, which generates synchronously on click. When that returns nothing because
there is genuinely nothing to draw on, it says so rather than looking broken.
This is not the generic fallback copy that was removed earlier — that was
filler pretending to be a suggestion. This is a button that says what it does.
Two inputs, which is what this always should have been.
**L3.** The consolidated read on the learner — and in particular the
familiar/practising/unsure split in ``scope`` — is the single most useful thing
to know when proposing what to look at next, and it was not being read at all.
Now rendered through the memory parser (so footnote markers and their HTML
comments never reach the prompt) and bounded, with each slot's unspent budget
carried to the next: ``preferences`` is two lines, and its leftover is what
lets ``scope`` be shown in full. Section names pass through untranslated
because the consolidator writes them in the deployment's own language
("不确定" / "Unsure") and reading them is exactly the model's job.
**The last k activities, flat.** The per-surface quota and round-robin are
gone. What someone touched most recently is the signal; which surface it
happened on says nothing about whether they are in the middle of it. Noise is
still dropped, but now *before* the cut rather than after — placeholder titles
are the newest rows by definition, so "take k then filter" returns nothing on
an install where someone just opened three blank chats.
k defaults to 20 and is adjustable in Settings → Chat → Starting points. Per
user, not admin-gated: it changes the size of one prompt built from the
caller's own memory, not a resource anyone else shares.
**Language comes from the setting, not the caller.** The endpoint no longer
takes a language parameter; the service reads the learner's model-output
setting (Settings → Appearance), the same one the chat agent answers in. The
UI locale could resolve before settings loaded, and with one cache per user the
two would overwrite each other on every visit. This also retires the
scope+language throttle key — there is one language now, so one key.
On a real install this took the material from 5 traces to 18 plus 6k of
profile, and the proposals from "DeepTutor 这种 AI 助教如何实现启发式引导" to
"LangGraph 状态共享与竞争条件处理".
Found on a real install with 20+ sessions, where the slot stayed empty.
**A failed generation was cached as an answer.** One call failed shortly after
boot; the empty result was written with the fingerprint of the material it
failed on. The background pass then saw "fresh, and the material has not
changed" and skipped every retry — six hours of empty slot from one timeout.
An empty result is now only saved when it is the right answer (no material to
work from); an empty result produced despite having material is dropped, so
the next visit retries. Collecting the material once and passing it down is
what makes that distinction available.
**The throttle swallowed the language switch.** The component asked before
i18n settled, which resolves to "en" for everyone, so the cache was built in
English. The Chinese UI then asked for "zh", got nothing (a cached set in one
language is not an answer for another), and its background pass was throttled
behind the English one — for the whole interval, with a perfectly fresh cache
sitting there unusable. The throttle is now keyed by scope *and* language, and
the component waits for i18n's ready flag rather than guessing.
**The material was mostly noise.** A week's lookback plus label dedup left one
usable trace out of twenty sessions; the other two slots went to knowledge
bases the user had named "q" and "q2". Now: 30 days (dedup and per-surface caps
already bound the list, so a longer window means depth, not length), labels
under 3 chars dropped, placeholder titles dropped — those are the *newest* rows
by definition, so they were taking the budget from named work — and the brief
tells the model to skip the noise it still sees rather than build on it.
Also: the single delayed re-read assumed a model answers within 3.5s. A cold
provider does not, and the first visit is exactly when nothing is cached. Four
spaced attempts, stopping as soon as something lands.
The previous brief still produced lines that pointed *at* the traces —
"Redo the two eigenvalue questions you missed", "Pick up where Agentic RAG
retrieval left off". Those restate what the learner already knows they did.
They propose nothing to understand.
What earns a click is one step further out: read the traces for the *subject*
behind them, then name something specific about that subject worth
understanding. Same root, one jump.
Trace: [conversation, 2d ago] Agentic RAG retrieval flow
now: "How agentic RAG differs from naive RAG"
was: "Continue the Agentic RAG conversation" <- restates the trace
also bad: "Explore retrieval" <- a field, not a question
The brief now leads with that jump, shows it worked both ways, and asks for
three different *kinds* of question (a distinction, a mechanism, a why, a
boundary case) so the three do not collapse into one shape. The floor is
unchanged and still explicit: one step beyond a trace is the point, a subject
with no root in the material is invention.
The fixed fallback is gone. Its three lines named activities — exactly what
the brief now calls failure — and more importantly the whole value of this
slot is that it is about *this* learner's material; generic copy sitting there
teaches people to stop reading it. With nothing in memory, the component
renders nothing and the home screen looks as it did before. That also drops
the fixed/generated split and its i18n keys: everything rendered here is now
generated, so nothing in it goes through the translation table.
Two problems with the first pass, and they were the same problem.
The copy named activities, not subjects. "Explain a topic" fits any learner's
screen, which is exactly what makes it useless — it proposes nothing. The
model's brief now leads with concreteness and shows it both ways (BAD "Review
your notes" / GOOD "Redo the two eigenvalue questions you missed"), and the
label bound goes 40 → 60 chars because naming the actual thing costs words.
The fixed starters shown to a learner with no history got the same treatment:
they cannot name that learner's material, but they can still propose a
concrete first move.
And a specific sentence in a pill reads as a tag, not as an invitation. So the
pills are gone: one line each, left-aligned to the composer's own edge, serif,
no border or fill, with an arrow that is the only coloured thing at rest and
steps right on hover.
Note the colour is written as color-mix rather than `text-[var(--x)]/60` —
that Tailwind form compiles to nothing, and the arrow was silently inheriting
its parent's colour until this was checked against the computed style.
Each chip renders its label and sends its prompt — the whole sentence the
learner would have typed — so one click starts a real conversation instead of
prefilling something they still have to finish. No handoff is involved: the
home screen is already a draft session while it has no messages, so the chips
go through the same send path as the composer, which both creates the session
and starts it on the topic.
The time-of-day greeting above the composer is untouched. Chips sit between
the composer and the flex spacer, so they ride up with it on the empty screen
and disappear the moment there is a first message.
Generated text does NOT go through the i18n table — a generated label that
happened to match a key would be silently replaced by an unrelated
translation. Only the fixed starters are keys, and the component tracks which
of the two it is holding.
Nothing renders until the first response lands: chips appearing a beat late is
calmer than fixed copy visibly swapping for generated copy. A failed read
falls back to the fixed starters rather than an empty row, and a reroll that
comes back empty keeps what is already on screen.
* fix(knowledge): add GraphRAG model compatibility layer
* fix(graphrag): harden compatibility preflight
* fix: align GraphRAG compatibility with current dev
* test: skip GraphRAG config test without optional extra
---------
Co-authored-by: Bingxi Zhao (Frank) <13051345080@163.com>
* 文档:明确 IMA 只读连接流程
* 文档:细化 IMA 连接状态与安全边界
* 文档:制定 IMA 只读连接实现计划
* 测试:固定 IMA 知识库列表协议
* 功能:支持枚举 IMA 知识库
* 功能:新增安全的 IMA 知识库列表接口
* 修复:说明 IMA 按知识库连接状态
* 功能:增加 IMA Web 连接接口
* 功能:接入 IMA 只读知识库连接表单
* 文案:补齐 IMA 连接流程中英文
* 修复:适配 IMA 知识库列表字段
* 修复:完善 IMA 认证与凭据清理
* 格式:统一 IMA 模块代码样式
* fix: load IMA source content safely
---------
Co-authored-by: TyrionH-is-coding <TyrionH-is-coding@users.noreply.github.com>
Co-authored-by: Bingxi Zhao (Frank) <13051345080@163.com>
Redact credentials from catalog responses and diagnostic streams, restore masked placeholders server-side, and resolve saved credentials for model discovery without returning them to the browser.
Web search was rebuilt onto a single spec table and six providers were
added on it — Doubao, Bocha, Zhipu, Firecrawl, Baidu Qianfan, and Aliyun
IQS. Consolidating seven copies of the provider list is what surfaced
three silent defects: Serper's `num` never reached the API, Serper
dropped its proxies, and Jina had no result-count limit. A runtime search
failure now walks the account's other credentialed profiles and finally
DuckDuckGo instead of failing the turn, recording the downgrade under a
top-level `search_fallback` key; a *missing* key still fails loudly for
the six new providers, five of which are China-hosted and cannot reach
the fallback anyway.
Also here, by way of main: LiteParse as a sixth document-parsing engine,
and MCP servers that reconnect when a stored credential is rotated and
report a dead transport as itself rather than as a tool timeout. Plus
CodeBuddy and OrcaRouter model providers, a persisted Codex
reasoning-effort override, and vision on OpenAI Codex.
Notes: assets/releases/ver1-5-12.md
This commit also carries the README prose sync, the ten translated
READMEs (which gain the Open Source Partners section they were missing),
the release-notes archive sweep, and the version bump.
Two pieces of work land together because the second is built on the
first: the provider layer was consolidated onto one spec table, then six
new providers were registered against it.
Layer overhaul
- Converge seven separate provider lists (backend registry, runtime
config, settings router, CLI wizard, frontend catalog, i18n, tests)
onto a single SEARCH_PROVIDERS spec table; every consumer derives from
it instead of keeping its own copy.
- Fix three silent defects: serper's `num` never reached the API (it was
swallowed by **kwargs, so max_results did nothing), serper dropped its
proxies, and jina had no result-count limit at all.
- A runtime failure (rate limit, timeout, unreachable network) no longer
fails the whole turn. The request walks the user's other credentialed
search profiles and finally DuckDuckGo, recording the downgrade under
a top-level `search_fallback` key so the trace shows what happened.
- Drop three provider modules that were never registered (exa, baidu,
openrouter). They stay in the deprecated list, so a stale config reads
as outdated rather than as a misspelled name.
Six new providers
doubao, bocha, zhipu, firecrawl, qianfan, aliyun_iqs — selectable under
Settings > Catalog > Search with their credential fields derived from the
spec table, and offered by `deeptutor init`. All six set
`soft_fallback=False`: five are China-hosted and the DuckDuckGo fallback
is unreachable on those networks, so a missing API key has to fail
loudly instead of silently timing out somewhere else.
Baidu returns as `qianfan` on the official Qianfan API; the old `baidu`
key stays deprecated.
* feat: add codebuddy provider
* fix: treat codebuddy as login-backed provider
* feat: sync codebuddy account models
* fix: ignore no-key placeholder for codebuddy
* feat: add codebuddy web login
* fix: streamline codebuddy settings and latency
* fix: support switching codebuddy accounts
* fix: preserve codebuddy sessions and tool calls
* feat: use CodeBuddy HTTP provider over Agent SDK
Chat with CodeBuddy over plain HTTP by reusing the login state that the
IDE plugin / CLI stores on disk, instead of bundling the ~130MB Agent SDK.
- add codebuddy_http_provider (OpenAI-compatible /chat/completions on
<endpoint>/v2) with codebuddy_credentials for local OAuth session reuse
- provider_factory picks HTTP transport whenever a login state or API key
is available; Agent SDK stays as fallback for CLI agent features
- demote codebuddy-agent-sdk from core deps to optional codebuddy extra
- default model codebuddy/default -> codebuddy/hy3
- update auth card UX and locales for SDK-less sign-in flow
* chore: label codebuddy provider as codebuddy/workbuddy in the dashboard
* style: apply pre-commit formatting after upstream merge
* chore: capitalise codebuddy provider label as CodeBuddy/WorkBuddy
---------
Co-authored-by: Bingxi Zhao (Frank) <13051345080@163.com>
* feat(codex): persist managed reasoning effort overrides
* fix(codex): protect managed catalog refresh state
* feat(codex): allow user reasoning overrides
Expose only owner-scoped managed Codex model metadata and validate updates against provider-supported reasoning levels. Add ordinary-user settings controls without granting model catalog or provider administration access.
* fix(codex): bind reasoning overrides to OAuth account
Persist only a one-way account binding on managed Codex profiles. Hide and reject stale or legacy-unbound reasoning controls until a successful catalog refresh, and do not carry overrides across account switches.
* fix(codex): reject stale cross-account overrides
* fix(codex): isolate account switches at runtime
* fix(web): repair malformed strong-emphasis spacing in assistant output
* style(web): keep removeEmptyMarkdownTables' loop header as dev has it
The branch reformatted an untouched line ('; )' -> ';)'). The repo's real
style is not what .prettierrc reports, so a stray prettier pass here would
land as unrelated churn in the squashed commit.
* fix(web): make the strong-emphasis repair fail-safe
The rewrite paired an opening ``**`` with the next one on the line
regardless of whether the line's markers pair off at all, so it corrupted
Markdown the renderer already handles correctly (checked against the
repo's own micromark):
- ``In Markdown, use ** to make text **bold**.`` lost its bold — the
capture was allowed to start at whitespace, so a literal ``**`` in
prose swallowed the sentence up to the next opener.
- ``**Note: **Important**`` became ``**Note:** Important**``, dropping
the bold and leaking a stray ``**``.
- ``**重點 **必讀** 內容**`` — valid nested emphasis — lost most of its
bold.
Anchor the capture at a non-space, require it to end at a colon (the
reported shape), and skip any line whose ``**`` count is odd: with an odd
count at least one marker is literal or unclosed, and there is no way to
tell which two were meant to pair. Bailing out is free — the line then
renders exactly as it does without this repair. Also skip indented code
blocks, which are shown verbatim and are not masked with the fenced ones.
---------
Co-authored-by: Bingxi Zhao (Frank) <13051345080@163.com>
What happens while the answer is still being written. Prose that shared a
round with a tool call vanished into the trace, a truncated generation read as
the model deciding it had finished, and local indexing sat on the event loop
everything else needed.
- DSML tool calls are stripped from the stream incrementally instead of
all-or-nothing. Once a round's content channel showed markup, the rest of it
was diverted to the thinking channel, so any prose around the call left the
answer. DSMLStreamFilter suppresses only the envelope and the invoke blocks;
text before, between and after streams and persists (turn_runtime carries
answer_visible rounds into the assembled answer). An incomplete invoke is
released verbatim by flush, and a 512-char ceiling stops a stray `<` in
ordinary prose from making the live stream wait for a closing bracket.
- DSML parameter decoding consults the declared schema. DeepSeek marks
essentially every parameter string="true", arrays and objects included, so a
container argument reached the tool as a string of JSON. A parameter the
schema types array/object is parsed when the payload actually matches; the
provider's string contract still wins elsewhere. The catalog is kept when a
provider rejects native `tools` and the loop falls back to DSML — exactly
when the parser needs it.
- The round budget is three stages: exploration, a bounded settlement window
(MAX_SETTLEMENT_ROUNDS, tools still available so an already-started
interaction can finish), then one tool-less hard finish. A `length` finish is
an incomplete generation, not a decision to stop: the visible prefix is kept
and a continuation requested, under the same upper bound of exploration + 4.
- Resident memory across the process tree, at GET /api/v1/system/memory and in
the settings strip. runtime/memory_probe.py walks the tree; psutil is
imported lazily with a /proc fallback, so a missing wheel costs the strip and
not the app, and non-admins get {available: false}. The strip drops
LLM/Embedding/Search, which restated what the Models and Chat pages own.
- Local LightRAG indexing runs on a worker thread's own event loop.
RAG-Anything's local backends do synchronous graph merging and JSON
serialization inside async methods, stalling unrelated API and LLM work;
OwnerLoopBridge forwards LLM, vision and embedding calls back to the
request's loop with a copy of the caller's contextvars.
- Mastery works from the persisted question. learning/pending.py projects a
PendingQuestion into the public contract (prompt, type, label/body map) with
the expected answer server-side; ask_user renders that instead of display
data the model re-authored, and registration validates the quiz shape rather
than silently accepting a contradictory one.
- Connected KBs answer honestly about local files (empty listing, explicit 409
where a local file is required) instead of resolving a raw/ directory that
does not exist. resolve_public_output_path replaces is_public_output_path so
the new request-scoped /api/outputs endpoint authorizes and resolves in one
operation and fails closed with no request user. Visualize iframes measure
body content so they shrink as well as grow, and the chat page's model list
is fetched once behind a single-flight hook.
test_forced_finish_still_reports_the_tools_the_turn_carried asserted the old
two-stage budget (exhausted exploration = the next call is the tool-less
finish); it now drives through settlement to reach the real hard finish. Also
syncs the README prose, all ten translations, and the release-notes archive.
Work in progress carried over from earlier sessions, committed together.
Chat / DSML:
- Tolerate partial and malformed tool-call tags mid-stream, with a character
ceiling so a stray "<" cannot make the live stream wait forever for its
closing bracket.
- Narration rounds can now mark their prose as visible, so a DSML round that
keeps the text surrounding a call has it persisted as part of the answer.
Runtime observability:
- New deeptutor/runtime/memory_probe.py reports resident memory across the
process tree, exposed at /api/v1/system/memory and surfaced in the settings
status strip. psutil is a soft dependency, imported lazily with a /proc
fallback, so a missing wheel costs the strip and not the app.
Mastery:
- New deeptutor/learning/pending.py projects a persisted PendingQuestion into
the smaller public contract safe to hand the tutor model, and owns the
multiple-choice translations shared by registration and grading.
LightRAG:
- New pipelines/lightrag/worker.py moves local indexing onto a worker thread's
own event loop, so RAG-Anything's synchronous graph merging stops stalling
unrelated API and LLM work.
Also: request-scoped output artifact delivery (api/routers/outputs.py),
partner runtime and path_service adjustments, and CLI chat renderer updates.
A Codex token authorizes one person's ChatGPT plan, so the profile is
correctly never grantable — but the OAuth endpoints were admin-only too,
which left ordinary users unable to reach Codex by any route: they could
neither be given the administrator's profile nor sign in for themselves.
What made per-user sign-in unsafe was where the profile landed:
``get_model_catalog_service()`` resolves a non-admin to the ADMIN catalog, so
a user's sync would have published their profile into the shared one. A
sign-in now publishes into the owner's own catalog, keyed by the same owner
resolution as the credential store, so a login and its profile can never
land in different places. Ordinary users get
``data/users/<uid>/settings/model_catalog.json``; an administrator gets the
shared catalog exactly as before.
``redacted_model_access`` — the one place grants are resolved — gains those
personal rows (source="personal") for the caller's OWN id only, so the
option list, the capability gate, and selection validation agree without
three separate merges, and an administrator inspecting somebody's grants
still sees only what they assigned. The resolution path merges the same
profiles so a personal selection resolves to a real profile, with the
owner's copy winning over a shared profile of the same managed id (the ids
are per-provider constants, and the administrator's copy lists their models,
not the user's).
Runtime token ownership needed no change: the provider already reads the
token per owner. Endpoint gating is narrower rather than absent — a partner
is refused, since it is a synthetic user whose owner is a real account and
admitting one would mean acting on that person's login, sign-out included.
The restricted-user Settings → LLM page grows the connect/refresh/sign-out
card (no catalog, no credentials), and a sign-in now drops the cached model
options so a freshly connected account does not keep seeing the old list.
* feat: separate UI and model response languages
* refactor(settings): keep one owner for the interface.json language rules
The legacy migration — a file written before the UI/response split
inherits its single language into both fields — had been duplicated into
both readers of interface.json, as had the theme/language defaults. Two
copies of a migration rule drift.
Move the rule into resolve_languages() in the module that owns the file,
have the router compose its superset of defaults on top of the service's,
and cover the agreement with a test that reads one legacy file through
both paths. The helper also drops the separate key-presence check:
_normalize_language already falls back to its default for missing, null
and unrecognized values alike.
* fix: keep the language bootstrap single and local-choice-first
Merging dev surfaced three collisions this branch had not seen:
- The new bootstrap fetched /settings/ui unconditionally and overwrote
writeStoredLanguage on every mount, undoing #730's rule that a choice
made in this browser is the more specific signal and must win. Folded it
into the existing guarded effect so one fetch serves both language
fields and neither can clobber a local selection.
- apiFetch/apiUrl ended up imported twice in AppShellContext, which git
merged without a conflict and tsc rejects outright.
- Three tests still stubbed get_ui_language at call sites that now ask for
get_response_language: the question router's stand-in module and two
mastery_path patches (renamed the zh case to say response language).
* fix(api): include response_language in the pre-session UI read
The bootstrap adopts both languages from this one endpoint, so leaving
response_language out of the projection meant a fresh browser always
inherited the interface locale and never saw the saved output-language
preference. It belongs with the other two: all three are the visitor's
own presentation choices, none describe the deployment.
---------
Co-authored-by: Bingxi Zhao (Frank) <13051345080@163.com>
* fix: stop Partner responses with Escape
Fixes#766
* fix(partners): let an open overlay keep Escape for itself
The streaming Escape listener is bound on window, so it also fired for
dismissals aimed at a Modal, PickerShell, ConfirmDialog or preview
drawer — closing the dialog killed the partner's answer with it. Bail
while any overlay is mounted; every one of them carries a dialog role
and unmounts on close, so the DOM answers the question directly.
---------
Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
Co-authored-by: Bingxi Zhao (Frank) <13051345080@163.com>
The interface language is persisted in the backend's ui settings, but only the settings route ever read it into state — so /home and every other page started in English until the user picked the language again in that browser.
The app shell now adopts the saved value once after mount, and only when the browser has recorded no choice of its own, so a local selection still wins. It goes through apiFetch (works with auth enabled), leaves the routes statically prerendered, and keeps the zh locale a lazy chunk.
Also replaces the duplicated "New conversation" sentinel check with a shared helper — the chat header showed the untranslated English sentinel the same way the sidebar did — and adds three composer aria-label keys that were referenced but missing from both catalogs.
Closes#729.
Models → LLM now exposes a per-model reasoning-effort default, persisted on the catalog entry and honored by the existing ResolvedLLMConfig path. Options are provider- and family-specific because the adapters do not share one enum, and a value already stored stays listed even when the table excludes it, so a profile sending a rejected value can be reset to Auto.
Also fixes two Anthropic request-building bugs the selector would have made reachable: an off-sentinel effort (`none`/`minimal`) used to fall through to the budget branch and turn thinking ON on pre-4.7 families, and `adaptive` was offered to families that only accept enabled+budget_tokens.
Closes#735.
Memory. A v1.5.7 source deployment grew past 14 GB before V8 aborted; the
causes were independent, so this cut fixes each one and bounds what was
previously unbounded.
- The dev server was never actually capped: `next dev` renders in a worker it
spawns, and V8 flags in argv are not inherited, so
`node --max-old-space-size=4096 .../next dev` never reached the process
holding the memory. Next then substituted 50% of total RAM — a 12 GB heap on
a 24 GB machine. web/scripts/dev.mjs routes the ceiling through NODE_OPTIONS
(which the worker inherits and Next honors), clamped to 4 GB and sized off
the cgroup limit in a container.
- Source installs serve a production build: `deeptutor start` builds once into
.next-deeptutor and reuses it until a fingerprint over the web/ tree, the
version file, or the build-time public settings changes. `--dev` is the
opt-in for HMR and keeps using .next, so neither mode invalidates the other.
- LLM clients and providers come from a bounded event-loop-local LRU pool of 2
instead of one per turn, closed on shutdown and retired on a settings
reload; only the selected backend's SDK is imported.
- Caches gained ceilings: knowledge-task log streams cap events and bytes per
task with a 1h TTL and a completion tombstone, the completed-task table
keeps 256, the LlamaIndex index cache drops 8 -> 2 with a 10-minute idle
evict, and a book runtime is released when its queue drains.
- After a turn, a finished book job, or a completed KB task, cycles are
collected and glibc is asked to return free pages via malloc_trim; the
container and launcher set MALLOC_ARENA_MAX=2 and a lower trim threshold,
both operator-overridable.
- Every uvicorn launch sets --timeout-keep-alive 300. web/proxy.ts forwards
over Node's http.globalAgent, whose 5s idle reaper matched uvicorn's default
exactly; both ends raced to close the same socket and the loser's request
died with ECONNRESET ("Failed to load sessions").
- deeptutor.agents, deeptutor.core.agentic, provider_core, the document
extractor's parser libraries and the LLM error-mapping rules resolve on
first use. `python -m deeptutor.api.run_server` no longer reloads by
default (DEEPTUTOR_DEV_RELOAD=1 restores it).
README prose and all ten translated READMEs now describe the production-build
default instead of dev mode. Release notes: assets/releases/ver1-5-8.md
Per-account MCP Services and CLI Apps — the two ways a deployment plugs in
tools DeepTutor never shipped — plus the isolation that makes them safe on a
shared install.
- MCP Services: a 45-entry curated store of hosted servers each account
installs for itself, OAuth 2.1 (PKCE + dynamic client registration) for the
servers that require it, static keys held by reference and resolved in memory
at connect time, stdio refused for self-service. Settings no longer
configures MCP; /settings/mcp redirects to the store.
- CLI Apps: 101 tools snapshotted from the two CLI-Anything registries.
Installs are admin-only, the registry's install_cmd is parsed into an argv we
build rather than executed, npm install scripts are forced off, and 66
first-party entries are pinned to one reviewed commit. Apps land in
data/cli-apps, one environment each, mounted read-only into the runner.
- Credentials that authorise a person move to data/system, the one branch the
exec sandbox never mounts: Codex tokens relocate themselves on first use
(refusing to follow a symlink), per-user MCP configs and keys land beside
them.
- Grants gain a cli_apps whitelist with the same deny-by-default posture as
MCP tools; a per-turn registry view keeps one owner's provider tools out of
the process-global registry and refuses an unauthorised tool at execute, not
just in the manifest.
- The composer reports what filled this turn's context window, a gutter rail
jumps back through long conversations, and the workspace collapses to a
drawer on small screens.
- The composer keeps focus after sending and across tab switches (#720);
released images carry provenance and SBOM attestations (#722).
README prose, all ten translated READMEs, and the docs-site pages that named
Settings → MCP are updated to match. Release notes:
assets/releases/ver1-5-7.md
Restores focus to the chat textarea on the next animation frame after a
successful send, and re-focuses it when the window regains focus if it
was focused when the window blurred. Closes#697, which asked for both
halves.
Follows the window-focus + visibilitychange listener pair already used in
the home page, memory panels, and the capability-access context.
Maintenance release on top of v1.5.5, finishing the Codex sign-in it
shipped and adding a connected knowledge engine.
- Tencent IMA joins as a connected knowledge engine: a KB bound to `ima`
is a connection pointer, not an index, following the lightrag-server
shape. Documents are added in IMA and retrieval calls IMA's OpenAPI;
credentials (client_id + api_key) and the library id live per-KB, so
each user on a shared deployment retrieves through their own account.
- The activity panel splits what a conversation produced from what you
uploaded: generated files get their own card above attachments, with a
size and a hover title derived from the artifact URL, so no absolute
server path is persisted or sent to the browser.
- Remote Codex OAuth completes (#716): the loopback listener stays
private while the exact callback path is forwarded through the Web
origin to a state-validating broker, with the real callback address,
the SSH tunnel command, an authorize action, and a reload-surviving
countdown surfaced in the settings card and CLI.
- That callback is delivered by OAuth state rather than the request's
user, since the browser arrives through the user's own tunnel with no
session cookie -- without it remote sign-in returned login_not_active
for every non-administrator. Partner scopes resolve Codex credentials
to the owner's root (#713) instead of the partner's synthetic
workspace.
- parse_language() no longer collapses every non-English language to
Chinese (#712), which is why a Japanese book came back with Chinese
quizzes; prompt fallbacks now try [code, base locale, "en"].
- Assorted: book creation and block regeneration run over WebSocket to
dodge proxy timeouts with non-streaming spine synthesis (#707, routed
through the agent seam so image attachments, trace metadata, and
per-agent routing survive), deeptutor start installs web/node_modules
when missing (#710), admin user management is localized (#718), and
the service lazy loader uses literal import paths (#717).
README prose, the ten translated READMEs, release notes, and the version
bump ride along in this commit.
Files the tutor produces were only reachable through the one assistant
bubble that made them, so finding a deck or spreadsheet again meant
scrolling the transcript. The activity panel already folded every
message's attachments into one list but ignored the `generated` flag that
distinguishes output from upload, lumping both into "Attachments".
Split them: generated files get their own card, above uploads, since what
a conversation produced is what you come back for. Rows reuse the
existing open-in-viewer path, and show a size plus a hover title with the
file's location under the data root — derived from the artifact URL, so no
absolute server path is persisted or sent to the browser.
Two gaps behind "I can't find the file" are fixed with it:
- A generated .pptx routed to the preview drawer's `office-text` branch,
which renders `extracted_text` — a field only the upload path filled
in, so produced decks opened blank. Artifacts now get preview text
extracted while the file is still on disk, bounded to 20k chars and
limited to formats the browser cannot render itself. The cancelled-turn
path deliberately skips it rather than starting blocking work while
unwinding.
- Path resolution goes through `is_public_output_path`, the same guard
`/api/outputs` applies, so a crafted URL cannot walk out of the public
workspace.
The artifact→attachment mapping moves out of `turn_runtime` into its own
module, and the panel's 90-line message fold moves to `lib/session-activity`
— it is pure data reduction with no React in it, which leaves the panel
presentational and the fold directly testable.
For a remote or containerized deployment the browser's localhost is the
user's workstation while the OAuth listener runs on the server, so a
reverse proxy cannot deliver http://localhost:1455/auth/callback to that
private listener and Codex sign-in could never complete.
Keep the listener loopback-only and forward just the exact browser
callback path through the Web origin to a state-validating broker. The
settings card and CLI now show the real callback address, the SSH tunnel
command, an explicit authorize action and a countdown, and survive a page
reload; the deployment docs cover the Docker host-port and reverse-proxy
caveats.
The listener stays bound to loopback and ports 1455/1457 are never
published; the Web bridge rewrites only /auth/callback; the broker
requires an active operation and a constant-time state match; callback
responses are no-store HTML that never echo the code or state; PKCE and
the token exchange are unchanged. Binding the listener with
start_serving=False also closes a window where a connection could be
accepted before the callback object existed.
Routes the remaining admin, sign-out, confirm-dialog and toast copy through i18next and adds the matching en/zh entries, so switching DeepTutor to Chinese no longer leaves account management in English.
Maintenance release on top of v1.5.4, with two new ways to bring a model.
- OpenAI Codex is a first-party OAuth provider (#690): browser sign-in
against your own ChatGPT plan replaces the API-key fields, credentials
stay in <user-root>/private/openai-codex/ with owner-only permissions,
and the managed profile is owner-bound so it is never handed out through
grants or made active over an already-configured LLM.
- Eden AI joins as the 35th LLM binding (#671), an OpenAI-compatible
gateway addressed as <provider>/<model>.
- Knowledge bases answer from a real document inventory instead of
guessing from retrieval hits: a per-KB inventory rides the system prompt
and a new kb_files tool enumerates on demand with glob/substring
filters, mounted under rag's gate and deniable per partner.
- The rag tool cites the chunks, entities, and reports retrieval actually
returned (#694) rather than an echo of its own query; the local LightRAG
pipeline still surfaces nothing to cite.
- GraphRAG indexing runs on a worker thread with its own asyncio loop
(#695), so UVICORN_LOOP=asyncio is no longer needed, and two config
faults that broke the first run are fixed (#699).
- Assorted: unique optimistic message ids (#698, a v1.5.4 regression that
dropped the assistant reply from the visible thread), partner-chat
manual scrolling respected (#704), claude-opus-5 recognized as
effort-based (#703), Kimi models omit temperature outright, and
deeptutor start keeps relaying logs on legacy Windows code pages (#702).
- Typing: narrow the loopback callback server to asyncio.Server and gate
the msvcrt lock path on sys.platform so it type-checks off Windows.
Release notes: assets/releases/ver1-5-5.md
Replaces the oauth_cli_kit indirection with DeepTutor's own PKCE loopback
sign-in, an account-scoped live model catalog, and a Settings card that exposes
only the OAuth surface. Credentials live in `<user-root>/private/openai-codex/`
with owner-only permissions, atomic writes, and a generation guard that stops a
late refresh from resurrecting a signed-out session; `~/.codex` is never read or
modified. A CLI path shares the same service.
A Codex token authorizes one person's ChatGPT plan, so credentials anchor to the
signing-in account's own root and the managed profile is marked `owner_bound`:
`redacted_model_access` drops it for every caller, and it is not offered as an
assignable model. Signing in publishes the profile but only activates it when no
LLM is configured yet, so it never repoints a deployment that already has one.
Also from review: reschedule the status poll so one dropped response cannot
strand the card on "waiting"; defer the catalog reload when the operator has
unsaved edits instead of discarding them; log the real cause behind the generic
provider error; stop promising a retry when the token refresh actually failed;
bind both loopback stacks since `localhost` may resolve to either; and drop the
provider metadata fields nothing consumed.
Asked how many files a knowledge base holds, or whether some document is in
it, the model had only `rag` — and retrieval cannot answer either question:
the passages it returns say nothing about the size of the collection they
came from, so the model guessed from whichever chunks the query happened to
match. PageIndex KBs already answered correctly (their doc list is injected
into the system prompt) and Obsidian vaults have `list_notes`, which makes
this a wiring gap in the default engines rather than a limit of retrieval.
`deeptutor/knowledge/manifest.py` now owns a KB's document inventory as facts
read off disk, with two consumers that cannot disagree:
- the chat system prompt carries a per-KB inventory (count plus a truncated
name list), so a count costs no tool round-trip — the failure mode where a
weaker model never emits the call at all (cf. #532). Built once per turn on
a worker thread, keeping the prompt byte-stable for the whole turn;
- a new `kb_files` tool enumerates on demand with glob / substring filtering,
mounted under `rag`'s gate (a KB is attached) and deniable per partner the
same way.
The inventory reports the document set and the KB's index status, and stops
there. It deliberately does not report how many documents reached the index:
every per-file record available is unreliable — LlamaIndex's docstore.json
counts nodes (chunk-level, so it drifts with the chunking config, and costs a
multi-MB parse to read), metadata.json's file_hashes is only written on the
incremental-add path, and last_indexed_count is the last batch's size rather
than a total. A confidently wrong count is worse than none. The prompt block
also states the rule that retrieved passages must never be used to infer how
many documents a KB holds or whether one exists in it.
Connected KBs degrade honestly instead of reporting zero: linked folders and
Obsidian vaults are enumerated in place, while a remote LightRAG server and a
connected subagent are declared unlistable. Hidden OS/editor entries
(.DS_Store, .obsidian/) stop counting as documents, and get_info's
raw_documents reads the same definition, so the KB page and the chat answer
can no longer disagree about the same KB.
Deep Research is untouched: its block loop narrows tools to the four that
produce block-level evidence, and a file list is not evidence for a subtopic.
CreateKbModal's reset effect was keyed on the providers array, which the
4s background-indexing poll replaces on every tick, so typed input and
loaded files vanished while another KB was indexing. Reset only on the
closed-to-open transition, and keep the providers reference stable in
useKnowledgeBases when a refresh returns identical content.
Two quizzes in one chat session share positional question ids
(q_1..q_N), so answer state is turn-scoped (#487). But during
streaming generation the QuizViewer received turnId=null — the result
event only lands at turn end — which bypassed that scoping: the card
hydrated the previous quiz's answers through the legacy cross-turn
lookup, showed them as already answered, and auto-reported them back
with an empty turn_id while questions were still being generated.
- derive the quiz turn id from the streamed events themselves
(extractQuizTurnId); the result event stays authoritative
- QuizViewer: without a turn identity the card is local-only — no
notebook hydration, no auto-report, no upserts
- sqlite store: a lookup without turn_id now only matches the legacy
namespace (turn_id='') instead of falling back to other turns' rows
Maintenance release on top of v1.5.2.
- Themeable code blocks: Settings → Appearance gains a Code blocks panel
(syntax theme, line numbers, wrapping) applied across chat, Book, and
Co-Writer.
- My Agents connects four more coding CLIs — Gemini, Kimi, opencode, and
MiMo Code — alongside Claude Code and Codex.
- Atlas Cloud joins as an LLM provider (34 bindings total); DashScope text
embeddings route correctly and encoding_format is omitted for strict
OpenAI-compatible gateways.
- Reliability sweep: RAG coexists with an exclusive knowledge capability
(#650), DeepSeek DSML tool-call parsing (#666), autoscroll release (#649),
idempotent write_memory (#647), seeded persona presets (#659), plus Book
WebSocket streaming, partner filename/split fixes, Visualize fences, and
CLI UTF-8 input hardening.
- Packaging: cap requires-python to >=3.11,<3.14 so pip refuses 3.14 with a
readable message instead of a failed source build (#664).
Release notes: assets/releases/ver1-5-3.md
#648 kept code-block appearance state in three places — AppShellContext,
SettingsContext (a duplicate useState mirror + direct cross-context setters),
and the appearance page (its own useState + a storage/event listener) — kept
in sync via a custom event and belt-and-suspenders direct setters that a test
comment admitted papered over an effect-ordering worry.
Collapse to one owner. AppShellContext (already consumed by RichCodeBlock)
holds the state and hydrates it after the SSR-safe first render. SettingsContext
now reads the values from useAppShell and its update* setters delegate to the
AppShell setters (which normalize, persist to localStorage, and notify) before
mirroring to the backend; it keeps no local copy. The appearance page reads the
values from the settings context and drops its local mirror + event listener.
Behavior is unchanged (same values render, same persistence); there is just one
source of truth instead of three. Tests updated to assert the new wiring; full
web test suite green (211).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Pre-commit auto-fixes from the project's pinned prettier (alpha.8).
Pure formatting — long object/array literals and assert.equal() calls
broken across multiple lines to satisfy print-width. No logic changes.
Files: code-block-themes registry, RichCodeBlock renderer, AppShell +
SettingsContext plumbing, appearance settings page, and the 6 affected
test files. Also adds a missing trailing newline to
app-shell-storage-code-block.test.ts.
Follow-up to #615/#608/#634: the isComposingRef + composition-handler
trio duplicated across five textareas (ComposerInput,
SimpleComposerInput, ChatMessages edit, BookChatPanel, PartnerComposer)
becomes one useImeComposing() hook; the citation-anchor fallback chain
+ <details> auto-open duplicated in both markdown renderers moves to
lib/markdown-anchors.ts; and the chat scrollport reserves the
scrollbar gutter on both edges so the message column centers on the
same axis as header and composer on classic-scrollbar platforms.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The full-width refactor removed the parent px-6 inset the composer used
to sit inside, leaving the composer card 48px wider than the message
column. The composer root now carries its own px-6 (with the empty-state
cap bumped 720->768 so content width is unchanged in both states), and
the session-loading wrapper passes full height through so
SessionLoadingView's absolutely-positioned cancel button stays at the
chat-area corner instead of collapsing next to the spinner.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>