84 Commits

Author SHA1 Message Date
Bingxi Zhao (Frank)
02ba56793e chore: checkpoint backend stabilization workspace 2026-09-01 21:28:15 +08:00
Bingxi Zhao (Frank)
15c31267cc Merge pull request #1124 from evan188199-tech/codex/feat-learner-profile-controls
# Conflicts:
#	deeptutor/multi_user/identity.py
#	deeptutor/services/session/turn_runtime.py
2026-08-31 20:39:42 +08:00
Bingxi Zhao (Frank)
e06b366f69 Merge pull request #1112 from evan188199-tech/codex/feat-learner-account-presets
# Conflicts:
#	deeptutor/services/session/turn_runtime.py
#	web/locales/en/app.json
#	web/locales/zh/app.json
2026-08-31 20:21:34 +08:00
Bingxi Zhao (Frank)
efcee00757 Merge pull request #1036 from Zuan0/reading-citation-grounding
# Conflicts:
#	web/components/chat/home/ChatMessages.tsx
#	web/components/common/AssistantResponse.tsx
#	web/components/reading/ReaderPane.tsx
#	web/context/ReadingContext.tsx
#	web/context/UnifiedChatContext.tsx
#	web/lib/reading-turn-state.ts
#	web/tests/e2e/reading-citation-material.audit.ts
#	web/tests/reading-citations.test.ts
#	web/tests/reading-turn-state.test.ts
2026-08-31 19:34:01 +08:00
Bingxi Zhao (Frank)
1c918e87a8 Merge pull request #1032 from Zuan0/reading-chat-references
# Conflicts:
#	deeptutor/services/session/source_inventory.py
#	deeptutor/services/session/turn_runtime.py
#	tests/reading/test_turn_wiring.py
#	web/app/(workspace)/home/[[...sessionId]]/page.tsx
#	web/context/UnifiedChatContext.tsx
2026-08-31 19:19:38 +08:00
Bingxi Zhao (Frank)
1b7643c558 Merge pull request #1067 from evan188199-tech
# Conflicts:
#	deeptutor/agents/chat/agent_loop.py
2026-08-31 19:00:32 +08:00
Bingxi Zhao (Frank)
b47c97f3ff Merge pull request #1068 from evan188199-tech
# Conflicts:
#	deeptutor/services/session/turn_runtime.py
2026-08-31 18:46:13 +08:00
XZH
93d1a80310 feat(learner): add account-scoped learner profiles 2026-08-30 17:15:01 -07:00
XZH
8ea83989a6 feat(learner): add server-enforced account presets (#1111) 2026-08-30 06:47:11 -07:00
Bingxi Zhao (Frank)
515c2efd74 fix(session): avoid persisting implicit empty workspace mode 2026-08-30 18:27:26 +08:00
Bingxi Zhao (Frank)
7d23ed8a28 merge: integrate video learning and WebVTT fixes
# Conflicts:
#	deeptutor/capabilities/registry.py
#	deeptutor/runtime/bootstrap/builtin_capabilities.py
#	deeptutor/services/session/turn_runtime.py
#	tests/core/test_capabilities_runtime.py
#	web/app/(workspace)/home/[[...sessionId]]/page.tsx
#	web/components/common/AssistantResponse.tsx
#	web/context/UnifiedChatContext.tsx
#	web/lib/settings-nav.ts
#	web/locales/en/app.json
#	web/locales/zh/app.json
2026-08-30 18:07:23 +08:00
Bingxi Zhao (Frank)
f694f204a8 feat: add app updater and unify workspace chat flows 2026-08-30 17:40:47 +08:00
Bingxi Zhao (Frank)
ce7c2dc2dc release: v1.6.1 — one key, one navigator, one sidebar you arrange
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.
2026-08-30 13:19:42 +08:00
Bingxi Zhao (Frank)
d67fc1d515 fix(mastery): hand a topic's materials to the tutor that teaches it
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.
2026-08-30 02:51:02 +08:00
Bingxi Zhao (Frank)
43c9fe7ea0 feat(course): make a course the container, not a dashboard
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.
2026-08-30 00:09:36 +08:00
Bingxi Zhao (Frank)
fc0be68d6f wip: course / partner groups in progress 2026-08-29 22:29:53 +08:00
Bingxi Zhao (Frank)
5218e1da49 feat(settings): the task model is a service, configured like the LLM
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.
2026-08-29 21:46:15 +08:00
Bingxi Zhao (Frank)
a9f67eb3aa feat(settings): connections layer + per-task model pinning
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.
2026-08-29 11:50:10 +08:00
XZH
cc7221ed2b feat(chat): route explicit quiz requests (#807) 2026-08-28 10:21:41 -07:00
XZH
a32a9a98a1 fix(llm): persist DeepSeek reasoning across turns 2026-08-28 03:09:00 -07:00
Bingxi Zhao (Frank)
9e54429426 Merge codex/immersive-reading-v2 into dev
# Conflicts:
#	deeptutor/api/routers/mastery_path.py
#	tests/services/session/test_sqlite_store.py
#	web/app/(workspace)/home/[[...sessionId]]/page.tsx
#	web/components/sidebar/SidebarShell.tsx
2026-08-28 15:01:39 +08:00
Bingxi Zhao (Frank)
97a4d0eeef feat(reading): add immersive reading workspace 2026-08-28 14:58:48 +08:00
Bingxi Zhao (Frank)
d57d2983ef feat(mastery): complete v2 learning workflows 2026-08-28 14:58:43 +08:00
XZH
50d0472527 feat(video-learning): add YouTube immersive watching 2026-08-27 07:24:12 -07:00
Benjamin
e3d8b05c0d feat(reading): add chat section references 2026-08-27 16:15:28 +08:00
Bingxi Zhao (Frank)
6f05db5714 fix(session): preserve durable quiz followup context 2026-08-26 02:34:40 +08:00
Bingxi Zhao (Frank)
69b472b109 fix(courses): enforce organization and tutor grounding integrity 2026-08-26 02:25:23 +08:00
diffaudit-review
cdbcacace4 fix: ground selection tutor in source message
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.
2026-08-26 02:25:23 +08:00
diffaudit-review
3709c9e854 feat: add selection tutor and course workspaces 2026-08-26 02:25:23 +08:00
Bingxi Zhao (Frank)
11c0a1ed68 fix(chat): preserve ask-user protocol across fallbacks and history 2026-08-26 02:08:46 +08:00
Ademola Balogun
e4dda9ff77 feat: add per-conversation reasoning-effort override (#641) (#958)
* 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>
2026-08-24 16:34:50 +08:00
Bingxi Zhao (Frank)
7c6bcfaef7 release: v1.5.14
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
2026-08-19 17:34:52 +08:00
Bingxi Zhao (Frank)
96d6df9eb1 release: v1.5.13
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.
2026-08-17 11:22:26 +08:00
Bingxi Zhao (Frank)
94a6edd563 feat(mastery): harden path state and turn recovery 2026-08-17 09:57:55 +08:00
Bingxi Zhao
4d5effeaa4 fix: keep mastery teaching content visible (#855)
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.
2026-08-16 23:48:21 +08:00
Amir Fathi
a182ce7177 fix: persist completed turn message IDs for reconnects (#705)
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.
2026-08-16 23:07:15 +08:00
Bingxi Zhao (Frank)
a8e03347cb fix: decouple mastery paths from chat sessions (#810) 2026-08-12 16:11:35 +08:00
Bingxi Zhao (Frank)
712d4137f0 feat: DSML streaming robustness, memory observability, and mastery pending questions
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.
2026-08-09 02:31:44 +08:00
Bingxi Zhao (Frank)
4041c75d8e feat(multi-user): let each account sign in to its own Codex (#781)
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.
2026-08-07 21:09:40 +08:00
wayblink
be14c3ef23 feat: separate UI and model response languages (#758)
* 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>
2026-08-07 03:13:04 +08:00
Dongyu
67283cfeb1 fix(chat): make capability failures terminal instead of blank messages (#732)
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.
2026-08-03 20:27:43 +08:00
Bingxi Zhao (Frank)
ef5ce9f952 fix: RAM issues 2026-08-02 13:07:32 +08:00
Bingxi Zhao (Frank)
139e060395 feat(chat): collect a session's generated files in the activity panel
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.
2026-07-29 00:35:43 +08:00
Bingxi Zhao (Frank)
308a0606f9 perf(chat): eliminate the post-stream "generating" stall
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.
2026-07-24 17:35:19 +08:00
rncchen
dfbe2878a6 perf(session): flush buffered turn events in a single transaction (#678)
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.
2026-07-24 16:09:49 +08:00
Bingxi Zhao (Frank)
1bf11d13e7 prepare 1.4.7 2026-06-18 00:22:48 +08:00
Bingxi Zhao (Frank)
c9d387e2b6 super super great great update 2026-06-17 00:56:27 +08:00
Bingxi Zhao (Frank)
d5c6d6ba54 refactor: reuse single LLM gate in turn runtime; drop unwired guard
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>
2026-06-14 14:56:14 +08:00
Bingxi Zhao (Frank)
2cdbab4b63 docs:update readme 2026-06-13 20:44:49 +08:00
Bingxi Zhao (Frank)
46093e5e2b update msg 2026-06-11 20:03:34 +08:00