Model configuration was one layer replicated seven times: every service
stored its own profile with its own credentials, so a single OpenRouter
key had to be pasted into five separate pages. This release splits that
in two — a **connection** holds one vendor credential and links it down
to every service that vendor can serve, and a **task model** takes the
calls nobody asks for (naming a conversation, writing the composer's
starting points) off the model picked for actual reasoning. Both are
opt-in; existing per-service profiles resolve exactly as before.
Around that: Settings drops the card grid for a persistent searchable
navigator whose landing page answers "what state am I in" instead of
repeating the directory; Mastery Path files study conversations under
their topic and opens them in the tutor rather than dropping them on
/home; the sidebar folds features into More and reorders by drag; the
reading companion is rebuilt from /home's own chat components; and the
LightRAG engine talks to the SDK directly, so its extra no longer drags
MinerU in transitively.
Also back-merges PR #1041 (Anthropic SDK 1.x temperature via extra_body)
and PR #741 (owner-only auth secret/token files), which had been merged
straight into main and never flowed back to dev.
Release notes: assets/releases/ver1-6-1.md
Gates: pre-commit 15/15, ruff clean, pytest 5802 passed, web 450 node
tests, eslint 0 errors, docs build clean.
A mastery topic's sources were consumed exactly once — to ground outline
generation — and then never seen again. Tutoring carried none of them, while
the tutor's own system prompt claimed to "teach from the learner's own
materials". Asked "can you see the materials I gave you?", the tutor answered
"I can see them!" and cited a framework it had only ever read in a module name.
Express topic materials in the vocabulary the chat runtime already speaks: an
Attached-Sources-style manifest plus a {source_id: full_text} index. Filling
those two values on a mastery turn is enough — ExploreContextCapability
activates on a non-empty source_index and runs its read_source investigation
before the tutor's first LLM call. No new tool, no new loop, no change to any
other capability.
Books are split per chapter: a whole book cannot be one tool result, and a
chapter is the unit one knowledge point needs. Knowledge bases are listed but
carry no id — they are searched with rag, not read. Materials that cannot be
loaded are listed as unavailable rather than dropped, because being able to
name what it does not have is what stops the tutor inventing it.
Verified on a live turn against a real book: the tutor now calls
read_source(bk-...-ch_...) and answers with the six real chapters; pointed at
an unreadable book it says so and offers the knowledge base instead.
A course held the right model — the syllabus that gives progress a
denominator, resources as references, conventions apart from the
assistant's own notes — but almost nothing crossed the edges between it
and the surfaces it was supposed to contain.
Getting in. Course Study was offered in the composer's mode menu while
the only way to bind a course was a link on the course page, so choosing
it there produced a conversation identical to an inert one, and the mode
advised pressing a button that did not exist. The composer now carries
the binding next to the mode: shown whenever there is one, and offered
as an unfinished field in Course Study when there is not. `_course_id`
rides every turn, so detaching detaches and the pill can never drift
from what the turn actually saw.
What a conversation inherits. `default_capability` and `default_persona`
were stored, validated and returned by the API while changing nothing:
`_apply_course_defaults` only fills fields a payload *omits*, and this
composer always sent all of them. They are applied client-side now,
along with the course's knowledge bases, where the learner can watch the
mode and material become the course's before they type. The dialog grows
the editor they never had.
Conventions. "Every conversation in this course starts knowing these" was
true only if the model happened to call `course_overview`. They ride in
the per-turn summary now, and — because the promise is not scoped to one
mode — in the system prompt of any course-bound turn.
Coming back. Mastery Path and Immersive Reading now read `?course=`,
scope themselves to it, and attach whatever is built there; the tiles and
hand-offs pass it; the picker offers to start one. A course could only
ever reference what already existed, so filling a new one meant leaving,
building, and remembering to return.
Hand-offs. A target with no ref stored an opening line for an index that
never consumes it, which then surfaced weeks later in an unrelated path.
An unresolvable ref was passed straight through: observed live, a
syllabus unit id ("u2") sent as a mastery path, producing a card pointing
at a page that does not exist. Refs are checked against the subsystem
that owns them — existence, not membership, since a path built outside
this course routes perfectly well.
Also: the sidebar groups conversations by course, so filing them is
finally readable; a course-scoped notebook console no longer shows
another course's notes beside a list saying there are none (the clear
raced an in-flight detail fetch that landed after it); a hand-off the
model also printed as prose is not rendered twice; a provider error is no
longer stored as a conversation's permanent title; `/space/courses` goes,
having been an unreferenced copy of `/courses`; and the Visualize mode
description gets its missing Chinese.
Three things from a look at the new model pages.
The next section's rule was drawn on top of the cards: the grid and the
panels below it were siblings, so the container's spacing never applied
between them.
Cards that open now look like it — a chevron in the lower right that
shifts on hover, a border and tint that lift, a press that registers.
They read as panels that happened to be clickable, which is the same as
not clickable. Search cards draw no chevron, because they have no models
to open into, so the two kinds are told apart before you click.
And the task model was wrong twice over. It asked which model should
name conversations and which should write the starting points, as if
anyone would answer those differently — both are short, frequent, and
want the same small fast model. It is one setting now. It also asked for
that model through a flat dropdown, when it is the same kind of thing as
the LLM and deserves the same shape: the catalog carries a `task`
service, so the whole provider/model editor applies to it unchanged, and
a provider already set up for chat can be brought over instead of typed
again. Empty stays the default and the common case — both calls then
resolve the LLM exactly as before, and the page says so and shows which
model that currently is.
Two tests stopped hardcoding the list of services and derive it, so the
next one to be added needs only its own test written.
Model configuration was one layer replicated seven times: every service
stored its own profile with its own credentials, so a single OpenRouter
key had to be pasted into five separate pages. Every comparable product
(Dify, Open WebUI, Cherry Studio, RAGFlow) splits this in two — a
credential entered once, then a per-purpose assignment — so this adds
that split without disturbing what already works.
Connections
A connection holds one vendor credential (api_key / api_version /
extra_headers, plus an optional endpoint override). Linking creates one
ordinary profile per service that can use it, and the credential is
mirrored down on save rather than resolved on read — so every consumer
of the catalog keeps reading self-contained profiles and a linked
profile resolves exactly like a hand-typed one. Rotating the key in one
place reaches every linked profile; deleting a connection unlinks
rather than wipes. Anyone wanting a different key per service simply
never makes a connection.
Which services a vendor can serve is derived from the six provider
tables that already exist (new `connection_targets` in GET /settings),
so the web app keeps no second copy and adding a vendor to a service
table is enough to make it connectable.
Task models
Naming a conversation and writing the three home-screen starting points
are LLM calls nobody asked for — short, frequent, and fine on a small
fast model. Both can now be pinned to their own configured model from
Settings > Models > Task models. Unpinned is the default and a true
no-op: the title still follows the turn's own model and the starters
the active one, exactly as before. A pin at a deleted profile reverts
to inheriting rather than stranding the call.
Short selections such as rc carried only the raw token and an opaque parent session id. Capture the containing message id, resolve it from the parent session, and provide both the source message and exact selection to the tutor prompt.
* feat: add per-conversation reasoning-effort override (#641)
* refactor(config): parse the LLM selection once
`apply_llm_selection_to_catalog` already calls `LLMSelection.from_payload`,
so resolving the override parsed the same payload a second time — meaning a
malformed `reasoning_effort` was validated and raised from two places.
`from_payload` is idempotent on an already-parsed value, so parse once and
pass the object through.
Also correct the `VALID_REASONING_EFFORTS` comment: it called itself the
single source of truth while pointing at two things that are not the same
vocabulary. `reasoning_params.py` maps a level onto a provider's actual knob,
and the per-backend `efforts` lists say what each subagent CLI accepts (some
are empty — no effort flag at all). This constant is only the
request-validation union.
---------
Co-authored-by: Ademola <ademicho@gmail>
Co-authored-by: Frank <bingxizhao@novix.science>
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.
Preserve learner-facing Markdown emitted in Mastery tool rounds via the existing answer_visible contract. Ordinary tool narration remains trace-only.
Adds regression coverage for Markdown tables and teaching content that share a round with mastery_quiz.
Persist the terminal DONE event after attaching real user and assistant message IDs, so reconnecting clients can reconcile optimistic rows and preserve the correct conversation parent chain.
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>
A capability raising an exception emitted a metadata-less error plus a status-less DONE, so turn_runtime stamped the turn 'completed' and the frontend — which renders the error card only on turn_terminal — showed an empty assistant message.
The orchestrator now emits the error/DONE pair with turn_terminal and a failed status, turn_runtime persists the real outcome instead of an unconditional 'completed', and the unknown-capability branch emits a DONE it previously omitted.
Closes#731.
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.
The spinner (and a frozen tab) outlived the LLM stream by seconds and
grew with conversation length:
- DONE now carries the persisted user/assistant message ids so the
frontend reconciles its optimistic ids in place (lib/turn-reconcile)
instead of refetching, re-normalizing, and re-rendering the whole
session after every turn.
- The turn-event workspace mirror writes the whole batch in one append
off the event loop instead of one synchronous open/write per event.
- PocketBase gains a batch append_turn_events that uploads in the
background; the events.jsonl rglob flush in update_turn_status is
gone, and add_message returns the real record id.
- The streaming autoscroll pin is mutation/load-driven instead of an
unconditional 60fps scrollHeight read (forced layout) per frame.
Post-stream finalisation appended buffered events one at a time, each in
its own fsync'd commit (connection open + turn lookup + MAX(seq) + INSERT
+ UPDATE + COMMIT per event). On slow storage this dominates turn
finalisation: on a NAS with spinning disks each commit took ~0.65 s, so a
550-event turn kept the client spinner running for ~6 minutes after the
answer had fully streamed, because the terminal done event is only
published after the flush.
Add SQLiteSessionStore.append_turn_events, which assigns seqs and inserts
the whole batch inside one transaction (measured: 501 events in ~6 ms),
and make _flush_buffered_events prefer it, keeping the per-event path as
a fallback for stores without batch support. When the turn has vanished
(session deleted mid-drain) the flush now logs one summary line instead
of one warning per buffered event.
The turn path (chat/partners/mastery via turn_runtime) already enforces
LLM-grant access at its single enforcement point and surfaces a clear
terminal "no model assigned" rejection — so require_llm_access was never
wired to any endpoint and only duplicated that logic. Drop it (and its
guard-only tests) and have turn_runtime reuse has_capability_access, giving
the gate one source of truth shared with the frontend lock.
Frontend fixes kept from the original PR plus two corrections:
- capabilityForPath now matches on a path-segment boundary, so a sibling
route like /booket can't be swallowed by the /book prefix (+ regression).
- fix the misleading Knowledge sidebar comment — Knowledge needs no
per-user grant and is never gated.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>