Ship folder-based workspaces and data migration, daily practice, redesigned
provider and model settings, and streaming conversation improvements.
Synchronize README translations and document the archive/permanent-delete
upgrade behavior in assets/releases/ver1-6-9.md.
Reduce initial JavaScript by deduplicating English resources and loading
animation features after hydration. Keep the existing route size budgets.
Update regression fixtures and browser audits for scoped URLs and the new
settings and learning interfaces.
* feat(sessions): add recycle bin for deleted chats
Implements soft-delete for chat sessions so users can restore
accidentally deleted conversations from a recycle bin.
Backend:
- Schema migration adds deleted_at REAL column to sessions
- delete_session becomes a soft-delete (sets deleted_at timestamp)
- New store methods: restore_session, purge_session, list_deleted_sessions
- Session list queries exclude soft-deleted sessions
- API endpoints: GET /sessions/recycle-bin, POST /{id}/restore,
DELETE /{id}/purge (purge triggers attachment/mastery cleanup)
Frontend:
- RecycleBinSection: collapsible sidebar section listing deleted
sessions with Restore and Delete permanently actions
- Wired into SidebarShell via recycleBinSlot prop
- API client functions for list, restore, and purge
- en/zh translations for all recycle-bin UI strings
Tests: 6 backend tests covering the soft-delete lifecycle
* style: apply ruff format to sqlite_store
* fix(sessions): preserve recycled chat artifacts
* feat(sessions): fold #1444's backend into this recycle bin
#1444 built the same feature from the other end. This PR had the SQLite
column, the routes and the sidebar UI; #1444 had the protocol declarations,
the PocketBase implementation and the CLI wording. Neither shipped alone —
this one left multi-user deployments answering AttributeError on
/recycle-bin, and #1444 built a bin nobody could see. Closes#1444; its
backend is here.
Kept from here: one `deleted_at` column. #1444 carried `is_deleted` beside it
in both backends, and `deleted_at IS NOT NULL` already says everything the
boolean did — PocketBase now derives the outward `is_deleted` field from the
timestamp instead of storing it twice.
Taken from #1444: the naming, which turns out to fix the residual both PRs
shipped with. `delete_session` keeps meaning what every existing caller
already meant by it — remove the row — so `reading.py`'s two internal
cleanups need no patch: a deleted reading workspace still takes its sessions
with it instead of depositing them in a learner's bin, where restoring one
would resurrect a session pointing at a workspace that no longer exists. The
chat surface's delete is a separate, explicitly named `soft_delete_session`,
and `hard_delete_session` empties the bin. Both backends agree, and the
protocol declares all five so a backend cannot silently lack one again.
`test_entries_cascade_on_session_purge` becomes two tests, because there are
now two deletions worth pinning: one the bin can undo, and one that skips it
and cascades immediately.
Co-Authored-By: sjagadee <srini.jagadeesh@gmail.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
---------
Co-authored-by: XZH <cto@xzh.ai>
Co-authored-by: Bingxi Zhao (Frank) <13051345080@163.com>
Co-authored-by: sjagadee <srini.jagadeesh@gmail.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Both halves of the CI repair are kept: the inline octocat that pulls the
generated brand-icon table out of the app-shell chunk (this branch) and the
deferred session-organization list plus the settings-audit `matrix` locator
fix (#1282). The audit fixture keeps the richer editable-settings body and
the backend-independent catch-all, with the catch-all registered first so
the specific stubs still win.
SidebarShell rendered its footer GitHub mark through BrandGlyph, which pulls
lib/brand-icons.generated.ts (~95KB) into the chunk every route shares, so the
table was counted against every measured route budget. Render the same CC0
octocat path inline (byte-identical to the generated github entry) and let the
store surfaces that actually show brand rows keep importing the table through
BrandIcon. Routes drop ~90KB: / 305->211KB, /co-writer 324->231KB,
/co-writer/[docId] 525->431KB, all comfortably under budget.
Ship lighter isolated runtimes, richer Books and Mastery flows,
Reading/session polish, and explicit model API capabilities.
Release notes: assets/releases/ver1-6-4.md
Ship the breaking front- and back-end runtime and route refactor,
learner and guardian flows, grounded reading, knowledge and parser
updates, and recoverable long-running streams.
Release notes: assets/releases/ver1-6-3.md
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.
The Mastery Path sidebar, composer and progress ring, in four changes.
Study conversations are filed under their topic. They were already ordinary
chat sessions carrying `mastery_path_id`, so the sidebar had everything it
needed and used none of it: they sat loose among the recents, and a click
opened them on /home, which drops the outline, the waypoint header and the
tutor's own composer. `lib/mastery-session.ts` answers both questions in one
place, because a sidebar that files a conversation under a heading and then
navigates somewhere else is worse than one that does neither. Grouped
conversations are exempt from the eight-row cut on recents: a heading that
says "4" while listing two of them is worse than a slightly longer list.
The composer placeholder is written by the task model. "Ask your tutor about
X" was the third appearance of that waypoint on screen and proposed nothing,
and a learner who is stuck is stuck on what to ask. So it offers one question
the tutor's last message did not already answer, and Tab takes it. It is a
question and never an answer -- on a mastery path the learner produces the
understanding, so anything not ending in a question mark is dropped. Nothing
waits on the call: the static placeholder stands until a hint arrives, and a
failure just leaves it standing.
`/topics/index` exists because the sidebar refreshes on every stream end and
`/topics` answers with each path's whole knowledge map and source excerpts.
It is declared above `/topics/{path_id}`, which matches any single segment.
The connected-agent and persona chips reach every surface sharing the
composer. StandaloneComposer already filtered subagents out of the knowledge
picker, commented "they are their own composer control" -- and then never
mounted that control, so a connected agent was unreachable from Mastery Path,
Immersive Reading and quiz follow-ups alike. Owning the split once lifts all
three, and keeps them on the same composer the chat page renders.
The progress ring stops competing with the card it sits on. A bare "7" is an
id or a step number, not a measurement; `--primary` is what buttons and links
are, and the card is itself one; and a 2.5px round cap at low percentages
reads as a stuck spinner. Ink hairline, a real unit, and `--primary` kept for
the one moment it means something.
Self-hostable PageIndex, a fileable question bank, and third-party plugins.
- PageIndex: adds PageIndex OSS as its own knowledge-base type, bound to
the base's local library and driven by the configured LLM rather than a
PageIndex API key. Retrieval moves off the built-in MCP server (removed)
onto a workflow-owned reading loop that walks the document tree.
- Question bank: addEntryToCategory shipped in v1.3.6 and was never called
from the frontend, so categories could be created but never filled. The
quiz card now uses the shared CategoryMenu, the page is rebuilt around
search / batch selection / an unfiled inbox, and a new question_bank tool
lets the tutor file questions instead of misrouting them to write_note.
- Plugins: deeptutor.plugins was imported behind a try/except but the
module never existed — implemented, plus a deeptutor.loop_capabilities
group so third-party packages can register chat-loop capabilities.
Builtins win on name collisions; broken entry points are skipped.
- Parsing: remote Apache Tika engine (TIKA_SERVER_URL), with no local
package and no model download.
- LightRAG: the three indexing knobs from #877 get inputs under their own
Indexing divider; unsupported keywords are dropped with a warning.
- Knowledge bases: uploads take a destination folder, same-named documents
from different subtrees stop dropping one another, and linked folders
keep their source-relative structure — closing #866.
- Book: a learning-capture inbox with an explicit status lifecycle, and
drift warnings scoped to the KB documents that actually changed.
- Whisper: /whisper moves out of the primary nav into Learning Space →
More Projects, credited to its contributor; the room needs its own
capability package. The reusable half is CAPABILITY_COMPLETE forwarding
of a capability-declared body and its declared extras.
- README: a Collaborate badge beside the Docs badge, in all twelve
languages.
- Lint: nosec B608 on four false-positive question-bank queries (literal
fragments only, every value bound), and three mypy fixes.
Release notes: assets/releases/ver1-5-15.md
Adds a /whisper workspace page (seat switch, room_id from the stream, trainee-only whisper/debrief) over the existing unified-ws with capability + config.room_id, and lets a capability publish a body and declared extras on CAPABILITY_COMPLETE via context.metadata['agent_output'] / ['event_metadata'] — capability, session_id and turn_id stay unspoofable.
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.
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
Self-service /profile page (account info, icon/image avatar, sign out)
implementing the profile half of #553. Contributed by @IliaAvdeev.
Integration performed during merge onto current dev:
- Migrate ProfileLink and the profile page off the removed AUTH_ENABLED
build-time export to runtime auth status (auth.ts was refactored on dev
by #577). ProfileLink reads the full status via fetchAuthStatus (it needs
username/avatar, which the useAuthStatus hook does not expose); the page
gates on status.enabled.
- Resolve en/zh locale conflicts as a union of dev and PR keys.
- Honor EXIF orientation in createImageBitmap so the primary decode path
matches the <img> fallback.
- Drop an unreachable AUTH_ENABLED render guard in the profile page.
Verified locally: tsc, eslint, ruff, web node tests (142), pytest
tests/multi_user (81 passed).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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>
Remove the user-facing entry points so /learning no longer appears in the
product, while keeping all backend logic, the /learning pages/components, and
the capability registration intact for continued development.
- SidebarShell: drop the 'Learning' nav item (+ now-unused GraduationCap icon);
left a comment documenting how to re-expose it.
- Book page: stop wiring onLearn -> remove the 'Start learning' button path and
the handleLearn handler + its learning-api imports. BookLibrary keeps its
onLearn prop + button markup so re-enabling is a one-line prop pass.
The /learning routes remain reachable by direct URL for development.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
New self-contained deeptutor/learning/ subsystem (models, storage, service,
scheduler, grading) + 12-stage guided_learning capability, REST router, and
web learning pages, with 164 tests.
Conflict resolutions:
- services/llm/factory.py: kept dev's stream runner (allow_image_fallback
multimodal path); dropped the PR's incidental 300s asyncio.wait_for wrapper
and its now-orphaned TimeoutError handler / unused logger — the blanket
timeout is unrelated to guided learning, dev already has consumer-side
timeouts, and 300s would truncate long legitimate streams (book/research).
- web/components/sidebar/WorkspaceSidebar.tsx: kept dev's structure, added a
useCallback handleNewChat that cancels any in-flight streaming turn before
newSession() (mirrors handleDeleteSession) and wired it to onNewChat.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Centralize Gemini 2.5/3 reasoning_effort=none in
reasoning_params.default_reasoning_effort_for so Visualize / Chat /
Solve / agentic loop stop returning empty bodies on those models.
- Visualize: per-capability max_tokens default (16k) seeded from
DEFAULT_AGENTS_SETTINGS, defensive root-tag trim on SVG/HTML output,
graceful fallback when JSON-mode review step crashes.
- Fix#485: require_auth / require_admin are async so the
set_current_user ContextVar reaches the endpoint instead of being
discarded by anyio.to_thread.run_sync's worker-thread context copy.
Adds _install_current_user helper shared by HTTP + WebSocket.
- Reasoning + native-tools chat protocol: formal content stream must
still start with FINISH/TOOL/THINK/PAUSE; tool-call deltas no longer
force-resolve labels and implicit_think_label is ignored, so
protocol-repair catches missing labels instead of mis-routing turns.
- Smooth streaming on every chat surface: useSmoothStreamText through
AssistantResponse, pin-to-bottom (useLayoutEffect) on book chat +
quiz follow-up, data-chat-scroll-root opt-in for overflow-anchor:none.
- Sidebar: collapsible Recents region with own scroll viewport,
deterministic Lucide icon per session via SessionAvatar, Docs link
next to GitHub footer, "New Chat" button removed (nav handles it).
- Add Lemonade local provider (port 13305) — registry entry, README
Docker host-gateway row, providers.md docs.
- Context-window models-endpoint probe honors DISABLE_SSL_VERIFY via
TCPConnector(ssl=False).
- README: insert v1.4.2 release row, push v1.3.10 inside "Past
releases" fold, bump install opt-in note to v1.4.2.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Add PRACTICE_QUIZ stage between Feynman Check and Error Diagnosis
- Generate 5-10 practice questions per module, record attempts but don't gate mastery
- Fix auto-advance race: move stagesRef updates outside React setState callbacks
- Fix stale handleStreamEvent closure via ref pattern
- Fix PLAN stage permanent deadlock when modules not initialized
- Clear error state unconditionally on new stage_start
- Add cancelStreamingTurn to sidebar and chat page for proper cleanup
- Fix cancelStreamingTurn to handle missing turnId gracefully
- Keep empty page_ids refs for whole-book resolution in guided learning
After rebasing onto current dev (v1.3.10), several issues surfaced that the
original PR did not account for:
Frontend (rebase regressions from older PR base):
- web/lib/knowledge-api.ts: restore 6 KnowledgeBaseSummary fields
(id, source, assigned, read_only, provenance_label, available) that the
multi-user knowledge feature added between the PR base and current dev.
- web/app/(workspace)/agents/page.tsx: restore the array-vs-{bots}
response shape fallback; the tutorbot list endpoint returns either form.
- web/components/sidebar/BookRecent.tsx: wrap path with apiUrl() — the
apiFetch swap accidentally dropped the wrapper.
- web/components/space/MemorySection.tsx: restore try/catch error toasts
in loadMemory and clearMemory (still present in saveMemory and
refreshMemory; were dropped in load/clear).
Backend (decouple auth from middleware):
- Remove user_context_middleware from api/main.py. It was redundant with
require_auth (sets the user ContextVar for every protected route) and
ws_require_auth (sets it for every WebSocket). When AUTH_ENABLED=true and
a request had no valid token, the middleware fell back to
local_admin_user() — harmless because require_auth then raised 401, but
a latent footgun if any code reads the ContextVar before the dependency
resolves. Removing it makes the auth flow single-pathed and removes the
"ctx set twice" pattern.
- auth.py: add explicit type annotations to ws_require_auth (returns
Token | _WsAuthFailed) and the ws_auth_failed sentinel.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>